rr 0.4.7 → 0.4.8

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/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ * 0.4.8
2
+ - Fixed issue with Hash arguments
3
+
1
4
  * 0.4.7
2
5
  - Improved error message
3
6
 
data/Rakefile CHANGED
@@ -26,7 +26,7 @@ def run_suite
26
26
  end
27
27
 
28
28
  PKG_NAME = "rr"
29
- PKG_VERSION = "0.4.7"
29
+ PKG_VERSION = "0.4.8"
30
30
  PKG_FILES = FileList[
31
31
  '[A-Z]*',
32
32
  '*.rb',
@@ -33,7 +33,7 @@ module RR
33
33
 
34
34
  protected
35
35
  def equality_match(arg1, arg2)
36
- arg1.respond_to?(:__rr__eql?) ? arg1 == arg2 : arg1.eql?(arg2)
36
+ arg1.respond_to?(:'__rr__original_==') ? arg1.__send__(:'__rr__original_==', arg2) : arg1 == arg2
37
37
  end
38
38
  end
39
39
  end
@@ -77,25 +77,40 @@ module RR
77
77
  @predicate3 = 'third'
78
78
  end
79
79
 
80
- it "when mock.proxy ==, does not have infinite recursion" do
81
- mock.proxy(@predicate1) == @predicate1
82
- mock.proxy(@predicate2) == @predicate2
83
- ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should == ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2)
84
-
85
- mock.proxy(@predicate1) == @predicate1
86
- mock.proxy(@predicate2) == @predicate3
87
- ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should_not == ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate3)
80
+ describe "when mock.proxy ==" do
81
+ it "does not have infinite recursion" do
82
+ mock.proxy(@predicate1) == @predicate1
83
+ mock.proxy(@predicate2) == @predicate2
84
+ ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should == ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2)
85
+
86
+ mock.proxy(@predicate1) == @predicate1
87
+ mock.proxy(@predicate2) == @predicate3
88
+ ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should_not == ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate3)
89
+ end
90
+
91
+ it "matches Hashes properly (using ==)" do
92
+ mock.proxy(@predicate1) == {:foo => :bar}
93
+ @predicate1 == {:foo => :bar}
94
+ end
88
95
  end
89
96
 
90
- it "when mock.proxy .eql?, does not have infinite recursion" do
91
- mock.proxy(@predicate1).eql? @predicate1
92
- mock.proxy(@predicate2).eql? @predicate2
93
- ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should be_eql(ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2))
97
+ describe "when mock.proxy .eql?" do
98
+ it "does not have infinite recursion" do
99
+ mock.proxy(@predicate1).eql? @predicate1
100
+ mock.proxy(@predicate2).eql? @predicate2
101
+ ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should be_eql(ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2))
94
102
 
95
- mock.proxy(@predicate1).eql? @predicate1
96
- mock.proxy(@predicate2).eql? @predicate3
97
- ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should_not be_eql(ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate3))
103
+ mock.proxy(@predicate1).eql? @predicate1
104
+ mock.proxy(@predicate2).eql? @predicate3
105
+ ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate2).should_not be_eql(ArgumentEqualityFunctionalFixture.new(@predicate1, @predicate3))
106
+ end
107
+
108
+ it "matches Hashes properly (using ==)" do
109
+ mock.proxy(@predicate1).eql?({:foo => :bar})
110
+ @predicate1.eql?({:foo => :bar})
111
+ end
98
112
  end
113
+
99
114
  end
100
115
  end
101
116
 
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rr
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.7
6
+ version: 0.4.8
7
7
  date: 2008-01-23 00:00:00 -08:00
8
8
  summary: RR (Double Ruby) is a double framework that features a rich selection of double techniques and a terse syntax. http://xunitpatterns.com/Test%20Double.html
9
9
  require_paths: