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 CHANGED
@@ -3,7 +3,7 @@
3
3
  FlexMock is a simple mock object for unit testing. The interface is
4
4
  simple, but still provides a good bit of flexibility.
5
5
 
6
- Version :: 0.1.4
6
+ Version :: 0.1.5
7
7
 
8
8
  = Links
9
9
 
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'rake/testtask'
8
8
 
9
9
  CLOBBER.include("html", 'pkg')
10
10
 
11
- PKG_VERSION = '0.1.4'
11
+ PKG_VERSION = '0.1.5'
12
12
 
13
13
  PKG_FILES = FileList[
14
14
  '[A-Z]*',
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 === actual.to_s ||
390
- expected == actual
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.
@@ -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.4
7
- date: 2005-11-02 00:00:00 -05:00
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