assert-moar 0.0.2 → 0.0.3

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: 5f66d47fbf325c7a0c77b4b6ea7aa6939198d767
4
- data.tar.gz: b111a5298b79306751b2f02a9b1aac7503103ae1
3
+ metadata.gz: fcc1728ac901b97cddff74e59b689e5618f7c26e
4
+ data.tar.gz: 2b72423b1105203607a90bbde92c6c53d501d3d0
5
5
  SHA512:
6
- metadata.gz: e97bb46a2b2b0d4ef8dbb3fb97245bf01295e5a1470a0cf77da9be574b2d9d11102d5686bc1cfbdf0ad03f0da832988821bee2e5d5ef012f3af67239c9929078
7
- data.tar.gz: 3d2e5164f2ea5c2318d01c0e5fbeb9fe52dff02417b4c61bf0f4fd5cca5a6b9a4e62adabe71ecd43f4e4166ce28a82c13b36e6570717050737a07dbe0e022d37
6
+ metadata.gz: e1b90e1f8d9cf8543e3610071650b4f96ae9b325896666e1605ab4e6b752f85ddb186e2fc21f32d948d2edc29222cf6e5da76519935e4a0693451a2b1af38f96
7
+ data.tar.gz: f55cfd7da6a40088247728048a45627f402235869a01b78eab2b157b88ef2e2c48d0aea37f0e8536a1db88e45e0474103ffc53d98ccb7d1041ae16412195205c
@@ -1,3 +1,3 @@
1
1
  module AssertMoar
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,16 +1,20 @@
1
1
  module MiniTest::Assertions
2
2
  def assert_validates_presence_of(object, property)
3
3
  assert_valid(object)
4
+ tmp = object.send("#{property}")
4
5
  object.send("#{property}=", nil)
5
6
  refute object.valid?, "Expected object not to be valid"
6
7
  assert object.errors[property.to_sym], "Expected errors to exist for #{property}"
8
+ object.send("#{property}=", tmp)
7
9
  end
8
10
 
9
11
  def refute_validates_presence_of(object, property)
10
12
  assert_valid(object)
13
+ tmp = object.send("#{property}")
11
14
  object.send("#{property}=", nil)
12
15
  assert_valid(object)
13
16
  assert_nil object.errors[property.to_sym]
17
+ object.send("#{property}=", tmp)
14
18
  end
15
19
 
16
20
  def assert_valid(object)
@@ -25,6 +25,7 @@ class Minitest::AssertionTest < Minitest::Test
25
25
  double = ActiveRecordBaseDouble.new
26
26
  double.property = "foo"
27
27
  @tc.assert_validates_presence_of(double, :property)
28
+ assert_equal "foo", double.property
28
29
  end
29
30
 
30
31
  def test_refute_validates_presence_of
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assert-moar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bohn