Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make assertions against correct exception class for test framework #29

Merged
merged 1 commit into from

2 participants

@sgrif
Owner

Mocha does not raise ExpectationError when run from MiniTest. Change our
assertions to go against whatever Mocha is using for failed expectations. This change brings the entire suite green on MRI 2.0.0p0

@sgrif
Owner

Not sure why rake gave a non zero exit code on rbx, tests have 0 failures.

@croaky
Owner

@sgrif Nice! What do you think about also editing .travis.yml as part of this change?

From:

rvm:
  - 2.0.0
  - 1.9.3
  - 1.9.2
  - 1.8.7
  - rbx-18mode
  - rbx-19mode

matrix:
  allow_failures:
    - rvm: 2.0.0

To:

rvm:
  - 2.0.0
  - 1.9.3
  - 1.9.2
  - 1.8.7
  - rbx-18mode
  - rbx-19mode

matrix:
  allow_failures:
    - rvm: rbx-19mode
@sgrif
Owner

@croaky Good point. I've added that change.

@croaky
Owner

@sgrif It doesn't look like Travis is allowing Rubinius 1.9 to fail. I think we're missing a rvm: prefix in the allow_failures section.

@sgrif
Owner

@croaky Whoops! Everything seems to be correct, now.

@croaky
Owner

Bam! Ready to squash and merge.

@sgrif sgrif Make assertions against correct exception class for test framework
Mocha does not raise ExpectationError when run from MiniTest. Change our
assertions to go against whatever Mocha is using for failed expectations

Remove ruby 2.0.0 from allowed failures, add rbx-19
d1faa09
@sgrif sgrif merged commit e3cb776 into master
@sgrif sgrif deleted the sg-fix-minitest-integration-ruby-2.0 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 15, 2013
  1. @sgrif

    Make assertions against correct exception class for test framework

    sgrif authored
    Mocha does not raise ExpectationError when run from MiniTest. Change our
    assertions to go against whatever Mocha is using for failed expectations
    
    Remove ruby 2.0.0 from allowed failures, add rbx-19
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +1 −1  .travis.yml
  2. +2 −2 test/unit/mockery_test.rb
View
2  .travis.yml
@@ -8,4 +8,4 @@ rvm:
matrix:
allow_failures:
- - rvm: 2.0.0
+ - rvm: rbx-19mode
View
4 test/unit/mockery_test.rb
@@ -32,14 +32,14 @@ def test_should_raise_expectation_error_because_not_all_expectations_are_satisfi
mock_2 = mockery.named_mock('mock-2') { expects(:method_2) }
1.times { mock_1.method_1 }
0.times { mock_2.method_2 }
- assert_raises(ExpectationError) { mockery.verify }
+ assert_raises(ExpectationErrorFactory.exception_class) { mockery.verify }
end
def test_should_reset_list_of_mocks_on_teardown
mockery = Mockery.new
mock = mockery.unnamed_mock { expects(:my_method) }
mockery.teardown
- assert_nothing_raised(ExpectationError) { mockery.verify }
+ assert_nothing_raised(ExpectationErrorFactory.exception_class) { mockery.verify }
end
def test_should_build_instance_of_stubba_on_instantiation
Something went wrong with that request. Please try again.