Class: WsdlMapperTesting::GenerationTest
- Inherits:
-
SchemaTest
- Object
- Minitest::Test
- Test
- SchemaTest
- WsdlMapperTesting::GenerationTest
- Defined in:
- lib/wsdl_mapper_testing/generation_test.rb
Instance Method Summary collapse
- #assert_file_contains(*name, expected) ⇒ Object
- #assert_file_exists(*name) ⇒ Object
- #assert_file_is(*name, expected) ⇒ Object
- #context ⇒ Object
- #file(*name) ⇒ Object
- #path_for(*name) ⇒ Object
- #setup ⇒ Object
- #teardown ⇒ Object
- #tmp_path ⇒ Object
Methods inherited from SchemaTest
Methods inherited from Test
Instance Method Details
#assert_file_contains(*name, expected) ⇒ Object
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 |
#assert_file_exists(*name) ⇒ Object
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 |
#assert_file_is(*name, expected) ⇒ Object
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 |
#context ⇒ Object
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 |
#file(*name) ⇒ Object
39 40 41 |
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 39 def file(*name) File.read tmp_path.join(*name) end |
#path_for(*name) ⇒ Object
17 18 19 |
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 17 def path_for(*name) tmp_path.join(*name) end |
#setup ⇒ Object
5 6 7 |
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 5 def setup @tmp_path = TestHelper.get_tmp_path end |
#teardown ⇒ Object
9 10 11 |
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 9 def teardown @tmp_path.unlink end |
#tmp_path ⇒ Object
13 14 15 |
# File 'lib/wsdl_mapper_testing/generation_test.rb', line 13 def tmp_path @tmp_path end |