Class: WsdlMapperTesting::ImplementationTest

Inherits:
Test
  • Object
show all
Defined in:
lib/wsdl_mapper_testing/implementation_test.rb

Instance Method Summary (collapse)

Methods inherited from Test

#create_test_module

Instance Method Details

- (Object) assert_implements(abstract, implementation)



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/wsdl_mapper_testing/implementation_test.rb', line 5

def assert_implements(abstract, implementation)
  impl_methods = implementation.public_methods

  abstract.public_methods.each do |method_name|
    assert_includes impl_methods, method_name, "Expected #{implementation} to define method #{method_name}."

    method = abstract.method method_name
    impl_method = implementation.method method_name
    assert_equal method.arity, impl_method.arity, "#{implementation}##{method_name} has wrong number of arguments (#{impl_method.arity} instead of #{method.arity})"
  end
end