Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update Mocha dependency to 0.13.2 #24

Merged
merged 1 commit into from

2 participants

@joshuaclayton

No description provided.

@jferris
Admin

Looks good.

@joshuaclayton joshuaclayton merged commit 79505d5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 15, 2013
  1. @joshuaclayton
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +1 −1  bourne.gemspec
  2. +1 −1  lib/bourne/mock.rb
  3. +5 −5 test/unit/mock_test.rb
View
2  bourne.gemspec
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency('mocha', '0.13.1') # follow instructions in mock.rb to update
+ s.add_dependency('mocha', '0.13.2') # follow instructions in mock.rb to update
s.add_development_dependency('rake')
end
View
2  lib/bourne/mock.rb
@@ -6,7 +6,7 @@ module Mocha # :nodoc:
# Overwrites #method_missing on Mocha::Mock
# - pass arguments to .invoke() calls to create Invocation
# - keep lowest else branch (bourne code)
- # - update from https://github.com/freerange/mocha/blob/master/lib/mocha/mock.rb#L195
+ # - update from https://github.com/freerange/mocha/blob/master/lib/mocha/mock.rb#L227
# - update test/unit/mock_test.rb
class Mock # :nodoc:
def method_missing(symbol, *arguments, &block)
View
10 test/unit/mock_test.rb
@@ -15,7 +15,7 @@ class MockTest < Test::Unit::TestCase
def test_should_set_single_expectation
mock = build_mock
mock.expects(:method1).returns(1)
- assert_nothing_raised(ExpectationError) do
+ assert_nothing_raised(ExpectationErrorFactory.exception_class) do
assert_equal 1, mock.method1
end
end
@@ -40,7 +40,7 @@ def test_should_stub_everything
def test_should_be_able_to_extend_mock_object_with_module
mock = build_mock
- assert_nothing_raised(ExpectationError) { mock.extend(Module.new) }
+ assert_nothing_raised(ExpectationErrorFactory.exception_class) { mock.extend(Module.new) }
end
def test_should_be_equal
@@ -106,7 +106,7 @@ def test_should_not_raise_error_if_stubbing_everything
mock = build_mock
mock.stub_everything
result = nil
- assert_nothing_raised(ExpectationError) do
+ assert_nothing_raised(ExpectationErrorFactory.exception_class) do
result = mock.unexpected_method
end
assert_nil result
@@ -114,7 +114,7 @@ def test_should_not_raise_error_if_stubbing_everything
def test_should_raise_assertion_error_for_unexpected_method_call
mock = build_mock
- error = assert_raise(ExpectationError) do
+ error = assert_raise(ExpectationErrorFactory.exception_class) do
mock.unexpected_method_called(:my_method, :argument1, :argument2)
end
assert_match(/unexpected invocation/, error.message)
@@ -310,7 +310,7 @@ def test_should_remove_expectation_for_unstubbed_method
mock = build_mock
mock.expects(:method1)
mock.unstub(:method1)
- e = assert_raises(ExpectationError) { mock.method1 }
+ e = assert_raises(ExpectationErrorFactory.exception_class) { mock.method1 }
assert_match(/unexpected invocation/, e.message)
end
Something went wrong with that request. Please try again.