Class: WsdlMapperTesting::GenerationTest

Inherits:
SchemaTest
  • Object
show all
Defined in:
lib/wsdl_mapper_testing/generation_test.rb

Instance Method Summary (collapse)

Methods inherited from SchemaTest

#get_schema

Methods inherited from Test

#create_test_module

Instance Method Details

- (Object) assert_file_contains(*name, expected)



31
32
33
34
35
36
37
# 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

- (Object) assert_file_exists(*name)



21
22
23
24
# 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

- (Object) assert_file_is(*name, expected)



26
27
28
29
# 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

- (Object) context



43
44
45
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 43

def context
  @context ||= WsdlMapper::Generation::Context.new @tmp_path.to_s
end

- (Object) file(*name)



39
40
41
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 39

def file(*name)
  File.read tmp_path.join *name
end

- (Object) path_for(*name)



17
18
19
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 17

def path_for(*name)
  tmp_path.join *name
end

- (Object) setup



5
6
7
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 5

def setup
  @tmp_path = TestHelper.get_tmp_path
end

- (Object) teardown



9
10
11
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 9

def teardown
  @tmp_path.unlink
end

- (Object) tmp_path



13
14
15
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 13

def tmp_path
  @tmp_path
end