shoulda-change_matchers 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shoulda/change_matchers.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59450c0d5a11594fd9afed0f52ff6e108a617a27
|
4
|
+
data.tar.gz: 382cdaef3e37a0addfac67ff234f849952db2346
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83a511b047f3cde8cbf3682feac75a0ffdfe765eca108052c29d26b29b6db096da92d534622c814228a2b10df5424ebe618b9909d138fe6d7e0b1e59724da6cc
|
7
|
+
data.tar.gz: 306de30deb1e569b1d6f5addf7779c6435239e5bf56d00ef0ec56a38e196237af0e3fb3ac08878026ed86bf74613602b3e948e69e1c742a0e962fff5b1d7f820
|
@@ -54,10 +54,10 @@ module Shoulda
|
|
54
54
|
stmt << " to #{to.inspect}" if to
|
55
55
|
stmt << " by #{by.inspect}" if by
|
56
56
|
|
57
|
-
before = lambda { @_before_should_change = block
|
57
|
+
before = lambda { @_before_should_change = instance_eval(&block) }
|
58
58
|
should stmt, :before => before do
|
59
59
|
old_value = @_before_should_change
|
60
|
-
new_value = block
|
60
|
+
new_value = instance_eval(&block)
|
61
61
|
assert_operator from, :===, old_value, "#{description} did not originally match #{from.inspect}" if from
|
62
62
|
assert_not_equal old_value, new_value, "#{description} did not change" unless by == 0
|
63
63
|
assert_operator to, :===, new_value, "#{description} was not changed to match #{to.inspect}" if to
|
@@ -95,9 +95,9 @@ module Shoulda
|
|
95
95
|
# end
|
96
96
|
# end
|
97
97
|
def should_not_change(description, &block)
|
98
|
-
before = lambda { @_before_should_not_change = block
|
98
|
+
before = lambda { @_before_should_not_change = instance_eval(&block) }
|
99
99
|
should "not change #{description}", :before => before do
|
100
|
-
new_value = block
|
100
|
+
new_value = instance_eval(&block)
|
101
101
|
assert_equal @_before_should_not_change, new_value, "#{description} changed"
|
102
102
|
end
|
103
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoulda-change_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|