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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0417e72a57d9c695c877331703a5f4e9e9e7e8de
4
- data.tar.gz: 2ca6415edc8e00358071b1154eecb90f14faa140
3
+ metadata.gz: 59450c0d5a11594fd9afed0f52ff6e108a617a27
4
+ data.tar.gz: 382cdaef3e37a0addfac67ff234f849952db2346
5
5
  SHA512:
6
- metadata.gz: de78a4794806817d2dc9a6270edf641d7a35070681dbfb968c9d4913abd58bce47cd1816334e91257fb6b2ada0957550bcf31dce92f2eccb4215ff2ed21acde3
7
- data.tar.gz: 2c642fa14acb67b95679dae01a3b8dc5b4eede5dba540507e611e31bbb23cdd499abd3903507bc28dcb66edc208b96cf71eedfc9eafb7f3d461176362e699011
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.bind(self).call }
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.bind(self).call
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.bind(self).call }
98
+ before = lambda { @_before_should_not_change = instance_eval(&block) }
99
99
  should "not change #{description}", :before => before do
100
- new_value = block.bind(self).call
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.3
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-04-21 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake