verified_double 0.5.0 → 0.5.1

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: d5009534213dea01c257cd3ae51146bc3b851074
4
- data.tar.gz: 2fdb0e7501414b89f06ea63c886736b615a47604
3
+ metadata.gz: daa010e506d5bac557ecd6d866e90783556f0f47
4
+ data.tar.gz: e185e88d2f88a5337267d50598c34616242150a6
5
5
  SHA512:
6
- metadata.gz: 415c67746889f7cb267f8f792ec33c6dffd106b361c6bf72ecfca91a7f9625e2f8813c3ef0c9d5314ba1500dbf393f12bab591ae651641c0017ad662b867673f
7
- data.tar.gz: 56740f7d553a0ee07f42dce4f6b7bc2844228046d5640c207421585a8f0effe8401f717b20358241822c20c7b3b781cb2a7484e79a919ccdeceaac621687d9af
6
+ metadata.gz: 3e01c603415dd87dfcc15856c1f70aa1f75a0e9d1b8872480949c8da229cb9bd69ae6661b7db837db29abc94c44563e962d8f8457613c3dfd5b72fe5315989a4
7
+ data.tar.gz: fbc6ebaf22d52a0ea73f862c7b273eeda798eb2da085bd8c5bb0c0d03544efe3cab35066bf498836acfbeb3125cc266a097b6cfe19b5f7102aaadb6cffef481f
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ 0.5.1 - 2013-12-25
2
+ ------------------
3
+
4
+ * Minor README updates.
5
+
1
6
  0.5.0 - 2013-12-24
2
7
  ------------------
3
8
 
data/README.md CHANGED
@@ -7,6 +7,7 @@ VerifiedDouble is a gem for verifying rspec mocks. The gem works similar to [rsp
7
7
  For example, if I mock the created_at method of a model like this:
8
8
 
9
9
  ```ruby
10
+ # spec/foo_spec.rb
10
11
  item = VerifiedDouble.of_instance(Item)
11
12
  expect(item).to receive(:created_at).and_return(Time.now)
12
13
  ```
@@ -14,6 +15,7 @@ expect(item).to receive(:created_at).and_return(Time.now)
14
15
  When I run the tests, the gem will look for a "contract test" tagged with the method's signature. This test should ensure that calling `#created_at` on Item will return a Time object.
15
16
 
16
17
  ```ruby
18
+ # spec/item_spec.rb
17
19
  describe Item do
18
20
  describe '#created_at()=>Time', verifies_contract: true do
19
21
  it "tests something" do
@@ -46,6 +48,7 @@ And require it when running rspec:
46
48
  Let's look again at the example above:
47
49
 
48
50
  ```ruby
51
+ # spec/foo_spec.rb
49
52
  item = VerifiedDouble.of_instance(Item)
50
53
  expect(item).to receive(:created_at).and_return(Time.now)
51
54
  ```
@@ -63,6 +66,7 @@ The following mocks are not verified:
63
66
  You can then tag the test for `Item#created_at()=>Time` with the method signature:
64
67
 
65
68
  ```ruby
69
+ # spec/item_spec.rb
66
70
  describe Item do
67
71
  describe '#created_at()=>Time', verifies_contract: true do
68
72
  it "tests something" do
@@ -76,11 +80,12 @@ Take note that:
76
80
 
77
81
  1. The described class must be a class, not a string.
78
82
  2. The described method must start with `#` if its an instance method and `.` if it's a class method.
79
- 3. You need to add the add the `verifies_contract: true` tag to the test.
83
+ 3. You need to add the `verifies_contract: true` tag to the test.
80
84
 
81
85
  If your testing style doesn't follow these conventions, you can tag the test with the whole method signature:
82
86
 
83
87
  ```ruby
88
+ # spec/item_spec.rb
84
89
  describe 'Item' do
85
90
  it "has a creation timestamp", verifies_contract: `Item#created_at()=>Time` do
86
91
  #...
@@ -92,6 +97,10 @@ Since VerifiedDouble relies on tags to link mocks and contracts together, you'll
92
97
  need to run the tests containing the contracts along with tests with the mocks in
93
98
  order to clear the VerifiedDouble warnings.
94
99
 
100
+ ```
101
+ rspec spec/foo_spec.rb spec/item_spec.rb
102
+ ```
103
+
95
104
  ## Booleans
96
105
 
97
106
  Since Ruby doesn't have Boolean class covering both `TrueClass` and `FalseClass`,
@@ -1,3 +1,8 @@
1
+ 0.5.1 - 2013-12-25
2
+ ------------------
3
+
4
+ * Minor README updates.
5
+
1
6
  0.5.0 - 2013-12-24
2
7
  ------------------
3
8
 
data/features/readme.md CHANGED
@@ -7,6 +7,7 @@ VerifiedDouble is a gem for verifying rspec mocks. The gem works similar to [rsp
7
7
  For example, if I mock the created_at method of a model like this:
8
8
 
9
9
  ```ruby
10
+ # spec/foo_spec.rb
10
11
  item = VerifiedDouble.of_instance(Item)
11
12
  expect(item).to receive(:created_at).and_return(Time.now)
12
13
  ```
@@ -14,6 +15,7 @@ expect(item).to receive(:created_at).and_return(Time.now)
14
15
  When I run the tests, the gem will look for a "contract test" tagged with the method's signature. This test should ensure that calling `#created_at` on Item will return a Time object.
15
16
 
16
17
  ```ruby
18
+ # spec/item_spec.rb
17
19
  describe Item do
18
20
  describe '#created_at()=>Time', verifies_contract: true do
19
21
  it "tests something" do
@@ -46,6 +48,7 @@ And require it when running rspec:
46
48
  Let's look again at the example above:
47
49
 
48
50
  ```ruby
51
+ # spec/foo_spec.rb
49
52
  item = VerifiedDouble.of_instance(Item)
50
53
  expect(item).to receive(:created_at).and_return(Time.now)
51
54
  ```
@@ -63,6 +66,7 @@ The following mocks are not verified:
63
66
  You can then tag the test for `Item#created_at()=>Time` with the method signature:
64
67
 
65
68
  ```ruby
69
+ # spec/item_spec.rb
66
70
  describe Item do
67
71
  describe '#created_at()=>Time', verifies_contract: true do
68
72
  it "tests something" do
@@ -76,11 +80,12 @@ Take note that:
76
80
 
77
81
  1. The described class must be a class, not a string.
78
82
  2. The described method must start with `#` if its an instance method and `.` if it's a class method.
79
- 3. You need to add the add the `verifies_contract: true` tag to the test.
83
+ 3. You need to add the `verifies_contract: true` tag to the test.
80
84
 
81
85
  If your testing style doesn't follow these conventions, you can tag the test with the whole method signature:
82
86
 
83
87
  ```ruby
88
+ # spec/item_spec.rb
84
89
  describe 'Item' do
85
90
  it "has a creation timestamp", verifies_contract: `Item#created_at()=>Time` do
86
91
  #...
@@ -92,6 +97,10 @@ Since VerifiedDouble relies on tags to link mocks and contracts together, you'll
92
97
  need to run the tests containing the contracts along with tests with the mocks in
93
98
  order to clear the VerifiedDouble warnings.
94
99
 
100
+ ```
101
+ rspec spec/foo_spec.rb spec/item_spec.rb
102
+ ```
103
+
95
104
  ## Booleans
96
105
 
97
106
  Since Ruby doesn't have Boolean class covering both `TrueClass` and `FalseClass`,
@@ -1,3 +1,3 @@
1
1
  module VerifiedDouble
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verified_double
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Mendoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-24 00:00:00.000000000 Z
11
+ date: 2013-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport