rspec-change_to_now 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemrelease +2 -0
- data/.gitignore +3 -0
- data/.travis.yml +1 -1
- data/Gemfile.lock +6 -1
- data/README.md +1 -1
- data/features/support/env.rb +2 -0
- data/lib/rspec/change_to_now/negate.rb +3 -3
- data/lib/rspec/change_to_now/version.rb +1 -1
- data/rspec-change_to_now.gemspec +2 -0
- data/spec/rspec/negate_spec.rb +38 -6
- data/spec/spec_helper.rb +2 -0
- metadata +30 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 668361d9c40f745f7705f9f4d5c51f07d9036cee
|
4
|
+
data.tar.gz: db0a2b4654dfcbb99d3204dcaa8e5925d24d328d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 277b53fff6b4bc3f74a6dd5523b8390cc333e584a0cfec0b3464eded6b30ca2113afd3a152ff89b049f985c1a1976e058f436209d2b143eccd68355f76b370af
|
7
|
+
data.tar.gz: 356f2ecbecaacaa44a2d2a3f203a941afba6adc7f2ec40ff3bb533912a9763551b59aefc3ab530e8f82252213f05171210eda33c01e0babd1d6842124105637a
|
data/.gemrelease
ADDED
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-change_to_now (1.0.
|
4
|
+
rspec-change_to_now (1.0.1)
|
5
5
|
rspec-core (>= 3.0.0)
|
6
6
|
rspec-expectations (>= 3.0.0)
|
7
7
|
|
@@ -15,6 +15,8 @@ GEM
|
|
15
15
|
builder (3.2.2)
|
16
16
|
childprocess (0.5.3)
|
17
17
|
ffi (~> 1.0, >= 1.0.11)
|
18
|
+
codeclimate-test-reporter (0.4.0)
|
19
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
18
20
|
coveralls (0.7.0)
|
19
21
|
multi_json (~> 1.3)
|
20
22
|
rest-client
|
@@ -31,6 +33,7 @@ GEM
|
|
31
33
|
docile (1.1.5)
|
32
34
|
ffi (1.9.3)
|
33
35
|
ffi2-generators (0.1.1)
|
36
|
+
gem-release (0.7.3)
|
34
37
|
gherkin (2.12.2)
|
35
38
|
multi_json (~> 1.3)
|
36
39
|
mime-types (2.3)
|
@@ -267,8 +270,10 @@ PLATFORMS
|
|
267
270
|
DEPENDENCIES
|
268
271
|
aruba (~> 0.5)
|
269
272
|
bundler (~> 1.3)
|
273
|
+
codeclimate-test-reporter (~> 0.4.0)
|
270
274
|
coveralls (~> 0.5)
|
271
275
|
cucumber (~> 1.3.8)
|
276
|
+
gem-release (~> 0.7.3)
|
272
277
|
rake (~> 10.1.0)
|
273
278
|
rspec-change_to_now!
|
274
279
|
rspec-mocks (>= 3.0.0)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RSpec::ChangeToNow [`rdoc`](http://rubydoc.info/github/dontfidget/rspec-change_to_now/) [![Build Status](https://travis-ci.org/dontfidget/rspec-change_to_now.png)](https://travis-ci.org/dontfidget/rspec-change_to_now) [![Code Climate](https://codeclimate.com/github/dontfidget/rspec-change_to_now/badges/gpa.svg)](https://codeclimate.com/github/dontfidget/rspec-change_to_now) [![Dependency Status](https://gemnasium.com/dontfidget/rspec-change_to_now.svg)](https://gemnasium.com/dontfidget/rspec-change_to_now) [![Gem Version](https://badge.fury.io/rb/rspec-change_to_now.svg)](http://badge.fury.io/rb/rspec-change_to_now) [![Coverage Status](https://coveralls.io/repos/dontfidget/rspec-change_to_now/badge.png?branch=master)](https://coveralls.io/r/dontfidget/rspec-change_to_now?branch=master)
|
1
|
+
# RSpec::ChangeToNow [`rdoc`](http://rubydoc.info/github/dontfidget/rspec-change_to_now/) [![Build Status](https://travis-ci.org/dontfidget/rspec-change_to_now.png)](https://travis-ci.org/dontfidget/rspec-change_to_now) [![Code Climate](https://codeclimate.com/github/dontfidget/rspec-change_to_now/badges/gpa.svg)](https://codeclimate.com/github/dontfidget/rspec-change_to_now) [![Dependency Status](https://gemnasium.com/dontfidget/rspec-change_to_now.svg)](https://gemnasium.com/dontfidget/rspec-change_to_now) [![Gem Version](https://badge.fury.io/rb/rspec-change_to_now.svg)](http://badge.fury.io/rb/rspec-change_to_now) [![Coverage Status](https://coveralls.io/repos/dontfidget/rspec-change_to_now/badge.png?branch=master)](https://coveralls.io/r/dontfidget/rspec-change_to_now?branch=master) [![Test Coverage](https://codeclimate.com/github/dontfidget/rspec-change_to_now/badges/coverage.svg)](https://codeclimate.com/github/dontfidget/rspec-change_to_now)
|
2
2
|
|
3
3
|
RSpec::ChangeTo adds the `to_now` and `not_to_now` methods to `change` matcher to describe how executing a block should change a matcher expectation.
|
4
4
|
|
data/features/support/env.rb
CHANGED
@@ -35,15 +35,15 @@ module RSpec
|
|
35
35
|
def failure_message
|
36
36
|
if @matcher.respond_to? :failure_message_when_negated
|
37
37
|
@matcher.failure_message_when_negated
|
38
|
-
elsif @matcher.respond_to :description
|
39
|
-
"expected #{surface_descriptions_in(@actual).inspect} not to #{surface_descriptions_in(@matcher).inspect}"
|
38
|
+
elsif @matcher.respond_to? :description
|
39
|
+
"expected #{surface_descriptions_in(@matcher.actual).inspect} not to #{surface_descriptions_in(@matcher).inspect}"
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
# @api private
|
44
44
|
# @return [String]
|
45
45
|
def failure_message_when_negated
|
46
|
-
failure_message
|
46
|
+
@matcher.failure_message
|
47
47
|
end
|
48
48
|
|
49
49
|
# @api private
|
data/rspec-change_to_now.gemspec
CHANGED
@@ -26,4 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.1.0'
|
27
27
|
spec.add_development_dependency 'aruba', '~> 0.5'
|
28
28
|
spec.add_development_dependency 'coveralls', '~> 0.5'
|
29
|
+
spec.add_development_dependency 'gem-release', '~> 0.7.3'
|
30
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4.0'
|
29
31
|
end
|
data/spec/rspec/negate_spec.rb
CHANGED
@@ -2,13 +2,45 @@ require_relative '../spec_helper'
|
|
2
2
|
|
3
3
|
RSpec.describe RSpec::Matchers::Negate do
|
4
4
|
describe "with literal expectations" do
|
5
|
-
|
6
|
-
|
5
|
+
describe "when not negated" do
|
6
|
+
describe "when the original matcher provides :does_not_match?" do
|
7
|
+
it "passes if the original matcher fails" do
|
8
|
+
expect(1).to negate(eq(2))
|
9
|
+
end
|
10
|
+
it "fails if the original matcher passes" do
|
11
|
+
expect {
|
12
|
+
expect(1).to negate(eq(1))
|
13
|
+
}.to fail_matching(/expected: value != 1.*got: 1/m)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
describe "when the original matcher does not provide :does_not_match?" do
|
17
|
+
it "generates the correct message if the original matcher passes" do
|
18
|
+
duck_matcher = double(
|
19
|
+
'matches?' => true,
|
20
|
+
description: 'be a duck',
|
21
|
+
actual: 'my duck',
|
22
|
+
failure_message: 'need this to convince the code that this is a matcher'
|
23
|
+
)
|
24
|
+
expect {
|
25
|
+
expect('my duck').to negate(duck_matcher)
|
26
|
+
}.to fail_matching(%Q|expected "my duck" not to (be a duck)|)
|
27
|
+
end
|
28
|
+
end
|
7
29
|
end
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
30
|
+
|
31
|
+
describe "when negated" do
|
32
|
+
it "passes if the original matcher passes" do
|
33
|
+
expect(1).not_to negate(eq(1))
|
34
|
+
end
|
35
|
+
it "fails unless the original matcher passes " do
|
36
|
+
expect {
|
37
|
+
expect(2).not_to negate(eq(1))
|
38
|
+
}.to fail_matching(/expected: 1.*got: 2/m)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it "returns a negated description" do
|
43
|
+
expect(negate(eq(1)).description).to eq "~(eq 1)"
|
12
44
|
end
|
13
45
|
end
|
14
46
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-change_to_now
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew S. Brown
|
@@ -122,6 +122,34 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.5'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: gem-release
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.7.3
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.7.3
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: codeclimate-test-reporter
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.4.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.4.0
|
125
153
|
description: RSpec extension gem for attribute matching
|
126
154
|
email:
|
127
155
|
- andrew@dontfidget.com
|
@@ -130,6 +158,7 @@ extensions: []
|
|
130
158
|
extra_rdoc_files: []
|
131
159
|
files:
|
132
160
|
- ".coveralls.yml"
|
161
|
+
- ".gemrelease"
|
133
162
|
- ".gitignore"
|
134
163
|
- ".travis.yml"
|
135
164
|
- Changelog.md
|