class WsdlMapperTesting::GenerationTest

Public Instance Methods

assert_file_contains(*name, expected) click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 31
def assert_file_contains(*name, expected)
  assert_file_exists(*name)
  content = file(*name)
  content_normalized = content.gsub(/^\s+/, '')
  expected_normalized = expected.strip.gsub(/^\s+/, '')
  assert content_normalized.include?(expected_normalized), "Expected\n\n#{content}\n\n to include\n\n#{expected}\n"
end
assert_file_exists(*name) click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 21
def assert_file_exists(*name)
  path = tmp_path.join(*name)
  assert File.exist?(path), "Expected file #{name * '/'} to exist."
end
assert_file_is(*name, expected) click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 26
def assert_file_is(*name, expected)
  assert_file_exists(*name)
  assert_equal expected, file(*name)
end
context() click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 43
def context
  @context ||= WsdlMapper::Generation::Context.new @tmp_path.to_s
end
file(*name) click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 39
def file(*name)
  File.read tmp_path.join(*name)
end
path_for(*name) click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 17
def path_for(*name)
  tmp_path.join(*name)
end
setup() click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 5
def setup
  @tmp_path = TestHelper.get_tmp_path
end
teardown() click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 9
def teardown
  @tmp_path.unlink
end
tmp_path() click to toggle source
# File lib/wsdl_mapper_testing/generation_test.rb, line 13
def tmp_path
  @tmp_path
end