flexmock 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +1 -1
- data/Rakefile +1 -1
- data/lib/flexmock.rb +2 -2
- data/test/test_should_receive.rb +9 -0
- metadata +2 -2
data/README
CHANGED
data/Rakefile
CHANGED
data/lib/flexmock.rb
CHANGED
@@ -386,8 +386,8 @@ class FlexMock
|
|
386
386
|
# Does the expected argument match the corresponding actual value.
|
387
387
|
def match_arg(expected, actual)
|
388
388
|
expected === actual ||
|
389
|
-
expected
|
390
|
-
expected
|
389
|
+
expected == actual ||
|
390
|
+
( Regexp === expected && expected === actual.to_s )
|
391
391
|
end
|
392
392
|
|
393
393
|
# Declare that the method should expect the given argument list.
|
data/test/test_should_receive.rb
CHANGED
@@ -147,6 +147,15 @@ class TestFlexMockShoulds < Test::Unit::TestCase
|
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
150
|
+
def test_arg_matching_with_string_doesnt_over_match
|
151
|
+
FlexMock.use do |m|
|
152
|
+
m.should_receive(:hi).with(String).returns(20)
|
153
|
+
assert_failure {
|
154
|
+
m.hi(1.0)
|
155
|
+
}
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
150
159
|
def test_arg_matching_precedence_when_best_first
|
151
160
|
FlexMock.use("greeter") do |m|
|
152
161
|
m.should_receive(:hi).with(1).once
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11.3
|
|
3
3
|
specification_version: 1
|
4
4
|
name: flexmock
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2005-11-
|
6
|
+
version: 0.1.5
|
7
|
+
date: 2005-11-13 00:00:00 -05:00
|
8
8
|
summary: Simple and Flexible Mock Objects for Testing
|
9
9
|
require_paths:
|
10
10
|
- lib
|