[MacRuby-devel] Mocha

Eloy Duran eloy.de.enige at gmail.com
Tue Dec 30 15:02:46 PST 2008


Yup, you're right.
Although trying to coerce it into a String is not necessary since this  
really is what you get on MR,
so I updated the test to check for that instead of String:
http://github.com/alloy/mocha/commit/f8c72b0f139714498488ff38534fc68e56f47430

 From some of the others I have distilled specific MR bugs and added  
failing test cases for those to known_bugs:
http://github.com/masterkain/macruby/commit/3cb0faa097f1a01aca7a8321a0a8ba097a3ff9ac
http://github.com/masterkain/macruby/commit/40455e95942cffb0b30001efb1bc4e55c05ed664
http://github.com/masterkain/macruby/commit/b3925d2adb39a8edfa1f1c85519d88aa04365080

I wonder if I should still create tickets for those as well now that I  
add tests for them to trunk?

- Eloy

On 30 dec 2008, at 21:00, Nic Williams wrote:

> I think some of the tests might need macruby-proofing:
>
> 3) Failure:
> test_should_describe_matcher(InstanceOfTest)
> [/Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
> parameter_matchers/instance_of_test.rb:22]:
> <"instance_of(String)"> expected but was
> <"instance_of(NSMutableString)">.
>
> perhaps: assert_equal(str, str.to_s) instead?
>
> On Wed, Dec 31, 2008 at 12:57 AM, Eloy Duran  
> <eloy.de.enige at gmail.com> wrote:
>> Hi (Laurent),
>>
>> I have been busy making mocha work on MR, which somewhat works now:
>> http://github.com/alloy/mocha/commits/macruby
>>
>> But there are quite some other interesting failures with the mocha  
>> tests,
>> which might be interesting to look into.
>>
>> Cheers,
>> Eloy
>>
>>
>>
>> % macrake test:units
>> (in /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha)
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/bin/macruby -w
>> -Ilib:test
>> "/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/rake/rake_test_loader.rb"
>> "test/unit/any_instance_method_test.rb" "test/unit/ 
>> array_inspect_test.rb"
>> "test/unit/backtrace_filter_test.rb" "test/unit/cardinality_test.rb"
>> "test/unit/central_test.rb" "test/unit/ 
>> change_state_side_effect_test.rb"
>> "test/unit/class_method_test.rb" "test/unit/ 
>> date_time_inspect_test.rb"
>> "test/unit/exception_raiser_test.rb" "test/unit/ 
>> expectation_list_test.rb"
>> "test/unit/expectation_test.rb" "test/unit/hash_inspect_test.rb"
>> "test/unit/in_state_ordering_constraint_test.rb"
>> "test/unit/metaclass_test.rb" "test/unit/method_matcher_test.rb"
>> "test/unit/mock_test.rb" "test/unit/mockery_test.rb"
>> "test/unit/multiple_yields_test.rb" "test/unit/no_yields_test.rb"
>> "test/unit/object_inspect_test.rb" "test/unit/object_test.rb"
>> "test/unit/parameter_matchers/all_of_test.rb"
>> "test/unit/parameter_matchers/any_of_test.rb"
>> "test/unit/parameter_matchers/anything_test.rb"
>> "test/unit/parameter_matchers/equals_test.rb"
>> "test/unit/parameter_matchers/has_entries_test.rb"
>> "test/unit/parameter_matchers/has_entry_test.rb"
>> "test/unit/parameter_matchers/has_key_test.rb"
>> "test/unit/parameter_matchers/has_value_test.rb"
>> "test/unit/parameter_matchers/includes_test.rb"
>> "test/unit/parameter_matchers/instance_of_test.rb"
>> "test/unit/parameter_matchers/is_a_test.rb"
>> "test/unit/parameter_matchers/kind_of_test.rb"
>> "test/unit/parameter_matchers/not_test.rb"
>> "test/unit/parameter_matchers/regexp_matches_test.rb"
>> "test/unit/parameter_matchers/responds_with_test.rb"
>> "test/unit/parameter_matchers/yaml_equivalent_test.rb"
>> "test/unit/parameters_matcher_test.rb" "test/unit/ 
>> return_values_test.rb"
>> "test/unit/sequence_test.rb" "test/unit/single_return_value_test.rb"
>> "test/unit/single_yield_test.rb" "test/unit/state_machine_test.rb"
>> "test/unit/string_inspect_test.rb" "test/unit/ 
>> yield_parameters_test.rb"
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/yaml/error.rb:30:
>> warning: can't create `Error' as an Objective-C class, because it  
>> already
>> exists, instead using `RBError'
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/yaml/error.rb:31:
>> warning: can't create `ParseError' as an Objective-C class, because  
>> it
>> already exists, instead using `RBParseError'
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/yaml/error.rb:32:
>> warning: can't create `TypeError' as an Objective-C class, because it
>> already exists, instead using `RBTypeError'
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/universal-darwin9.0/syck.bundle:
>> warning: can't create `Object' as an Objective-C class, because it  
>> already
>> exists, instead using `RBObject'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> backtrace_filter.rb:3:
>> warning: can't create `BacktraceFilter' as an Objective-C class,  
>> because it
>> already exists, instead using `RBBacktraceFilter'
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/timeout.rb:27:
>> warning: can't create `Error' as an Objective-C class, because it  
>> already
>> exists, instead using `RBError2'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> expectation_test.rb:422:
>> warning: can't create `FakeState' as an Objective-C class, because it
>> already exists, instead using `RBFakeState'
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/test/unit/collector/objectspace.rb:10:
>> warning: can't create `ObjectSpace' as an Objective-C class,  
>> because it
>> already exists, instead using `RBObjectSpace'
>> Loaded suite
>> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
>> 1.9.0/rake/rake_test_loader
>> Started
>> ...2008-12-30 15:53:31.686 macruby[4734:613] *** -[RBAnonymous12
>> reset_mocha]: unrecognized selector sent to instance 0x800910740
>> E.2008-12-30 15:53:32.026 macruby[4734:613] *** -[RBAnonymous18
>> reset_mocha]: unrecognized selector sent to instance 0x8004fa560
>> E 
>> ................................................................................................................................................................../Library 
>> /Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/pp.rb: 
>> 266:
>> warning: can't create `SingleLine' as an Objective-C class, because  
>> it
>> already exists, instead using `RBSingleLine'
>> F 
>> .................EE 
>> ......................FFE 
>> ...............EE 
>> ....EE 
>> ...........EEEE 
>> .E 
>> ......F 
>> .F.................................................................
>> Finished in 0.886303 seconds.
>>
>> 1) Error:
>> test_should_call_remove_new_method(AnyInstanceMethodTest):
>> RuntimeError: NSInvalidArgumentException: *** -[RBAnonymous12  
>> reset_mocha]:
>> unrecognized selector sent to instance 0x800910740
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> any_instance_method.rb:10:in
>> `reset_mocha'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> any_instance_method.rb:10:in
>> `unstub'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> any_instance_method_test.rb:83:in
>> `test_should_call_remove_new_method'
>>
>> 2) Error:
>> test_should_call_restore_original_method(AnyInstanceMethodTest):
>> RuntimeError: NSInvalidArgumentException: *** -[RBAnonymous18  
>> reset_mocha]:
>> unrecognized selector sent to instance 0x8004fa560
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> any_instance_method.rb:10:in
>> `reset_mocha'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> any_instance_method.rb:10:in
>> `unstub'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> any_instance_method_test.rb:98:in
>> `test_should_call_restore_original_method'
>>
>> 3) Failure:
>> test_should_describe_matcher(InstanceOfTest)
>> [/Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> parameter_matchers/instance_of_test.rb:22]:
>> <"instance_of(String)"> expected but was
>> <"instance_of(NSMutableString)">.
>>
>> 4) Error:
>> test_should_be_able_to_mock_standard_object_methods(MockTest):
>> ArgumentError: wrong number of arguments (0 for 1)
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:56:in
>> `block in test_should_be_able_to_mock_standard_object_methods'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:56:in
>> `each'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:56:in
>> `test_should_be_able_to_mock_standard_object_methods'
>>
>> 5) Error:
>> test_should_be_able_to_stub_standard_object_methods(MockTest):
>> ArgumentError: wrong number of arguments (0 for 1)
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:63:in
>> `block in test_should_be_able_to_stub_standard_object_methods'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:63:in
>> `each'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:63:in
>> `test_should_be_able_to_stub_standard_object_methods'
>>
>> 6) Failure:
>> test_should_raise_assertion_error_for_unexpected_method_call 
>> (MockTest)
>> [/Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:113]:
>> <Mocha::ExpectationError> exception expected but was
>> Class: <RangeError>
>> Message: <"integer 68738564352 too big to convert to `int'">
>> ---Backtrace---
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/names.rb: 
>> 48:in `%'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/names.rb: 
>> 48:in
>> `mocha_inspect'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 185:in
>> `mocha_inspect'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> unexpected_invocation.rb:12:in
>> `to_s'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 161:in
>> `method_missing'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:114:in
>> `block in  
>> test_should_raise_assertion_error_for_unexpected_method_call'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:113:in
>> `test_should_raise_assertion_error_for_unexpected_method_call'
>> ---------------
>>
>> 7) Failure:
>> test_should_raise_no_method_error_if_responder_does_not_respond_to_invoked_method 
>> (MockTest)
>> [/Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:272]:
>> <NoMethodError> exception expected but was
>> Class: <RangeError>
>> Message: <"integer 68743737024 too big to convert to `int'">
>> ---Backtrace---
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/names.rb: 
>> 48:in `%'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/names.rb: 
>> 48:in
>> `mocha_inspect'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 185:in
>> `mocha_inspect'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 155:in
>> `method_missing'
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:272:in
>> `block in
>> test_should_raise_no_method_error_if_responder_does_not_respond_to_invoked_method 
>> '
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:272:in
>> ` 
>> test_should_raise_no_method_error_if_responder_does_not_respond_to_invoked_method 
>> '
>> ---------------
>>
>> 8) Error:
>> test_should_raise_no_method_error_with_message_indicating_that_mock_is_constrained_to_respond_like_responder 
>> (MockTest):
>> RangeError: integer 68738934528 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> names.rb:48:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> names.rb:48:in
>> `mocha_inspect'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 185:in
>> `mocha_inspect'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 155:in
>> `method_missing'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mock_test.rb:284:in
>> ` 
>> test_should_raise_no_method_error_with_message_indicating_that_mock_is_constrained_to_respond_like_responder 
>> '
>>
>> 9) Error:
>> test_should_display_impersonated_object_for_inspect(MockeryTest):
>> RangeError: integer 68741115008 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `mocha_inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mockery_test.rb:132:in
>> `test_should_display_impersonated_object_for_inspect'
>>
>> 10) Error:
>> test_should_display_impersonated_object_for_mocha_inspect 
>> (MockeryTest):
>> RangeError: integer 68740732864 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `mocha_inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mockery_test.rb:125:in
>> `test_should_display_impersonated_object_for_mocha_inspect'
>>
>> 11) Error:
>> test_should_display_object_id_for_inspect_if_mock_has_no_name 
>> (MockeryTest):
>> RangeError: integer 68738532928 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> names.rb:48:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> names.rb:48:in
>> `mocha_inspect'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 185:in
>> `mocha_inspect'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 189:in
>> `inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mockery_test.rb:94:in
>> `test_should_display_object_id_for_inspect_if_mock_has_no_name'
>>
>> 12) Error:
>> test_should_display_object_id_for_mocha_inspect_if_mock_has_no_name 
>> (MockeryTest):
>> RangeError: integer 68736119808 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> names.rb:48:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> names.rb:48:in
>> `mocha_inspect'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/mock.rb: 
>> 185:in
>> `mocha_inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> mockery_test.rb:88:in
>> `test_should_display_object_id_for_mocha_inspect_if_mock_has_no_name'
>>
>> 13) Error:
>> test_should_return_default_string_representation_of_object_not_including_instance_variables 
>> (ObjectInspectTest):
>> RangeError: integer 68727223232 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `mocha_inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_inspect_test.rb:13:in
>> ` 
>> test_should_return_default_string_representation_of_object_not_including_instance_variables 
>> '
>>
>> 14) Error:
>> test_should_use_underscored_id_instead_of_object_id_or_id_so_that_they_can_be_stubbed 
>> (ObjectInspectTest):
>> RangeError: integer 68742647872 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `mocha_inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_inspect_test.rb:33:in
>> ` 
>> test_should_use_underscored_id_instead_of_object_id_or_id_so_that_they_can_be_stubbed 
>> '
>>
>> 15) Error:
>> test_should_build_any_instance_object(ObjectTest):
>> NoMethodError: undefined method `any_instance' for #<Class: 
>> 0x104daba10>
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_test.rb:33:in
>> `test_should_build_any_instance_object'
>>
>> 16) Error:
>> test_should_build_mocha_referring_to_self(ObjectTest):
>> RangeError: integer 68721495168 too big to convert to `int'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `%'
>>   /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/lib/mocha/ 
>> inspect.rb:9:in
>> `mocha_inspect'
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_test.rb:16:in
>> `test_should_build_mocha_referring_to_self'
>>
>> 17) Error:
>> test_should_return_same_any_instance_object(ObjectTest):
>> NoMethodError: undefined method `any_instance' for #<Class: 
>> 0x104dac280>
>>
>> /Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_test.rb:40:in
>> `test_should_return_same_any_instance_object'
>>
>> 18) Failure:
>> test_should_use_stubba_class_method_for_class(ObjectTest)
>> [/Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_test.rb:54]:
>> <Mocha::ClassMethod> expected but was
>> <Mocha::InstanceMethod>.
>>
>> 19) Failure:
>> test_should_use_stubba_module_method_for_module(ObjectTest)
>> [/Users/eloy/Documents/DEVELOPMENT/MacRuby/mocha/test/unit/ 
>> object_test.rb:50]:
>> <Mocha::ModuleMethod> expected but was
>> <Mocha::InstanceMethod>.
>>
>> 327 tests, 458 assertions, 5 failures, 14 errors
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>
>
>
> -- 
> Dr Nic Williams
> iPhone and Rails consultants - http://mocra.com
> Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com
> * Surf Report for iPhone - http://mocra.com/projects/surfreport/ *
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list