assert 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/assert/assertions.rb +2 -2
- data/lib/assert/version.rb +1 -1
- data/test/unit/assertions/assert_equal_tests.rb +21 -0
- metadata +4 -4
data/lib/assert/assertions.rb
CHANGED
@@ -27,7 +27,7 @@ module Assert
|
|
27
27
|
alias_method :refute_empty, :assert_not_empty
|
28
28
|
|
29
29
|
def assert_equal(exp, act, desc = nil)
|
30
|
-
assert(
|
30
|
+
assert(exp == act, desc) do
|
31
31
|
c = __assert_config__
|
32
32
|
exp_show = Assert::U.show_for_diff(exp, c)
|
33
33
|
act_show = Assert::U.show_for_diff(act, c)
|
@@ -42,7 +42,7 @@ module Assert
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def assert_not_equal(exp, act, desc = nil)
|
45
|
-
assert(
|
45
|
+
assert(exp != act, desc) do
|
46
46
|
c = __assert_config__
|
47
47
|
exp_show = Assert::U.show_for_diff(exp, c)
|
48
48
|
act_show = Assert::U.show_for_diff(act, c)
|
data/lib/assert/version.rb
CHANGED
@@ -61,6 +61,27 @@ module Assert::Assertions
|
|
61
61
|
|
62
62
|
end
|
63
63
|
|
64
|
+
class EqualOrderTests < Assert::Context
|
65
|
+
desc "with objects that define custom equality operators"
|
66
|
+
setup do
|
67
|
+
is_class = Class.new do
|
68
|
+
def ==(other); true; end
|
69
|
+
end
|
70
|
+
@is = is_class.new
|
71
|
+
|
72
|
+
is_not_class = Class.new do
|
73
|
+
def ==(other); false; end
|
74
|
+
end
|
75
|
+
@is_not = is_not_class.new
|
76
|
+
end
|
77
|
+
|
78
|
+
should "use the equality operator of the exp value" do
|
79
|
+
assert_equal @is, @is_not
|
80
|
+
assert_not_equal @is_not, @is
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
64
85
|
class DiffTests < Assert::Context
|
65
86
|
desc "with objects that should use diff when showing"
|
66
87
|
setup do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 2.7.
|
9
|
+
- 1
|
10
|
+
version: 2.7.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2014-
|
19
|
+
date: 2014-02-03 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
prerelease: false
|