Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix for mocha 0.12 vs 2.5.1 #35

Closed
wants to merge 1 commit into from

2 participants

@grosser

otherwise fails with

/Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/testsuite.rb:117:in `run_test': undefined method `responds_to?' for AccountDataCenterTest:Test::Unit::TestSuite (NoMethodError)
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/testsuite.rb:53:in `run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunnermediator.rb:93:in `run_suite'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunnermediator.rb:43:in `block in run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunnermediator.rb:82:in `with_listener'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunnermediator.rb:39:in `run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunner.rb:40:in `start_mediator'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunner.rb:25:in `start'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/ui/testrunnerutilities.rb:24:in `run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/autorunner.rb:378:in `block in run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/autorunner.rb:434:in `change_work_directory'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/autorunner.rb:377:in `run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit/autorunner.rb:58:in `run'
    from /Users/mgrosser/.rvm/gems/ruby-1.9.3-p194/gems/test-unit-2.5.1/lib/test/unit.rb:330:in `block in <top (required)>'
rake aborted!
@grosser

please bump-patch+release after merging this, I want dots+diff without monkeypatchs asap :)

@kou
Owner
kou commented

Could you show your test scripta that occurs the problem?
I want to confirm it on my environment.

@grosser

The problem seems to be mocha 0.12.0 you can play with it here:
https://github.com/grosser/soft_deletion/tree/foo

@kou
Owner
kou commented

Thanks for providing it. I could reproduce it on my environment.

It seems that it should be resolved in mocha not test-unit.
I submitted a pull request to mocha. :-)
freerange/mocha#89

So I'll close this issue.

@kou kou closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 5, 2012
  1. @grosser
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/test/unit/testsuite.rb
View
5 lib/test/unit/testsuite.rb
@@ -78,7 +78,7 @@ def size
@tests.each { |test| total_size += test.size }
total_size
end
-
+
def empty?
tests.empty?
end
@@ -88,7 +88,7 @@ def empty?
def to_s
@name
end
-
+
# It's handy to be able to compare TestSuite instances.
def ==(other)
return false unless(other.kind_of?(self.class))
@@ -114,6 +114,7 @@ def run_test(test, result)
finished_is_yielded = false
finished_object_is_yielded = false
previous_event_name = nil
+ return unless test.respond_to?(:run) # missing from some irrelevant things in ActiveSupport v2
test.run(result) do |event_name, *args|
case previous_event_name
when Test::Unit::TestCase::STARTED
Something went wrong with that request. Please try again.