rspec-change_to_now 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9ba7aa8d6cf543625b0c5d954cf86ad83b081ac
4
- data.tar.gz: f52abeb18cc26b383a9029be08ec73f8bdd8ecc9
3
+ metadata.gz: 668361d9c40f745f7705f9f4d5c51f07d9036cee
4
+ data.tar.gz: db0a2b4654dfcbb99d3204dcaa8e5925d24d328d
5
5
  SHA512:
6
- metadata.gz: 4b3886dd539cc7b538552cf827a3fd91d688b0337ef15a2cc3c923c57085f979486f691616116ddcfbe42f0fc6d774f4a7c28f05b1dc403b1ea3ecf1e7fc5244
7
- data.tar.gz: ebce57a0edef287ca49d13b54908de5b808b644da7750621e677ad0cb7cf2b8a6f723ca95f36a00bd3f387eb42843c6d0363ea3ae1589e881d10b0883ca46db7
6
+ metadata.gz: 277b53fff6b4bc3f74a6dd5523b8390cc333e584a0cfec0b3464eded6b30ca2113afd3a152ff89b049f985c1a1976e058f436209d2b143eccd68355f76b370af
7
+ data.tar.gz: 356f2ecbecaacaa44a2d2a3f203a941afba6adc7f2ec40ff3bb533912a9763551b59aefc3ab530e8f82252213f05171210eda33c01e0babd1d6842124105637a
data/.gemrelease ADDED
@@ -0,0 +1,2 @@
1
+ bump:
2
+ tag: true
data/.gitignore CHANGED
@@ -2,3 +2,6 @@
2
2
  .ruby*
3
3
  tmp
4
4
  .yardoc
5
+ doc
6
+ coverage
7
+ Gemfile.lock
data/.travis.yml CHANGED
@@ -3,4 +3,4 @@ rvm:
3
3
  - 2.1.2
4
4
  - 1.9.3
5
5
  - jruby-19mode # JRuby in 1.9 mode
6
-
6
+ env: CODECLIMATE_REPO_TOKEN=12db80c6f77604bc5a422b4ee47f54b0aaa12b0c4f07cc301ace9ba5d626cd92
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-change_to_now (1.0.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
 
@@ -1,5 +1,7 @@
1
1
  require 'coveralls'
2
2
  Coveralls.wear!
3
+ require "codeclimate-test-reporter"
4
+ CodeClimate::TestReporter.start
3
5
 
4
6
  require 'aruba/cucumber'
5
7
  require 'rspec/core'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module ChangeToNow
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -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
@@ -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
- it "passes if the original matcher fails" do
6
- expect(1).to negate(eq(2))
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
- it "fails if the original matcher passes" do
9
- expect {
10
- expect(1).to negate(eq(1))
11
- }.to fail_matching(/expected: value != 1.*got: 1/m)
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
@@ -1,5 +1,7 @@
1
1
  require 'coveralls'
2
2
  Coveralls.wear!
3
+ require "codeclimate-test-reporter"
4
+ CodeClimate::TestReporter.start
3
5
 
4
6
  require 'rspec/change_to_now'
5
7
 
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.1
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