rspec-block_is_expected 1.0.4 → 1.0.6

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +47 -3
  4. data/CODE_OF_CONDUCT.md +57 -47
  5. data/CONTRIBUTING.md +51 -0
  6. data/{LICENSE → LICENSE.txt} +1 -1
  7. data/README.md +236 -99
  8. data/SECURITY.md +13 -0
  9. data/lib/rspec/block_is_expected/matchers/not.rb +4 -4
  10. data/lib/rspec/block_is_expected/rspec.rb +7 -7
  11. data/lib/rspec/block_is_expected/shared_examples/block_does_not_raise_examples.rb +5 -0
  12. data/lib/rspec/block_is_expected/shared_examples/block_raises_error_examples.rb +5 -0
  13. data/lib/rspec/block_is_expected/version.rb +1 -1
  14. data/lib/rspec/block_is_expected.rb +2 -2
  15. data.tar.gz.sig +0 -0
  16. metadata +54 -84
  17. metadata.gz.sig +0 -0
  18. data/.gitignore +0 -15
  19. data/.rspec +0 -3
  20. data/.rubocop.yml +0 -52
  21. data/.rubocop_todo.yml +0 -32
  22. data/.tool-versions +0 -1
  23. data/.travis.yml +0 -61
  24. data/Appraisals +0 -32
  25. data/Gemfile +0 -22
  26. data/Gemfile.lock +0 -107
  27. data/Rakefile +0 -29
  28. data/bin/console +0 -14
  29. data/bin/setup +0 -8
  30. data/gemfiles/jruby_1.7.26.gemfile +0 -16
  31. data/gemfiles/jruby_9.1.9.0.gemfile +0 -15
  32. data/gemfiles/jruby_9.2.0.0.gemfile +0 -15
  33. data/gemfiles/jruby_head.gemfile +0 -15
  34. data/gemfiles/ruby_1.8.7_p374.gemfile +0 -16
  35. data/gemfiles/ruby_1.9.3_p551.gemfile +0 -16
  36. data/gemfiles/ruby_2.0.0_p648.gemfile +0 -16
  37. data/gemfiles/ruby_2.1.10.gemfile +0 -15
  38. data/gemfiles/ruby_2.2.10.gemfile +0 -16
  39. data/gemfiles/ruby_2.3.7.gemfile +0 -16
  40. data/gemfiles/ruby_2.4.4.gemfile +0 -16
  41. data/gemfiles/ruby_2.5.1.gemfile +0 -16
  42. data/gemfiles/ruby_head.gemfile +0 -16
  43. data/rspec-block_is_expected.gemspec +0 -41
data/README.md CHANGED
@@ -1,35 +1,138 @@
1
1
  # Rspec::BlockIsExpected
2
2
 
3
- This gem does one very simple thing very well. It allows you to use `block_is_expected` similarly to how you would use `is_expected` if a block was wrapping the subject. Supports the same versions of Ruby that RSpec does, 1.8.7 - current ruby-head, as well as the JRuby equivalents.
4
-
3
+ <div id="badges">
4
+
5
+ [![CI Build][🚎dl-cwfi]][🚎dl-cwf]
6
+ [![Test Coverage][🔑cc-covi]][🔑cc-cov]
7
+ [![Maintainability][🔑cc-mnti]][🔑cc-mnt]
8
+ [![Depfu][🔑depfui]][🔑depfu]
9
+
10
+ [🚎dl-cwf]: https://github.com/pboling/rspec-block_is_expected/actions/workflows/current.yml
11
+ [🚎dl-cwfi]: https://github.com/pboling/rspec-block_is_expected/actions/workflows/current.yml/badge.svg
12
+
13
+ [comment]: <> ( 🔑 KEYED LINKS )
14
+
15
+ [🔑cc-mnt]: https://codeclimate.com/github/pboling/rspec-block_is_expected/maintainability
16
+ [🔑cc-mnti]: https://api.codeclimate.com/v1/badges/ca0a12604ecc19f5e76d/maintainability
17
+ [🔑cc-cov]: https://codeclimate.com/github/pboling/rspec-block_is_expected/test_coverage
18
+ [🔑cc-covi]: https://api.codeclimate.com/v1/badges/ca0a12604ecc19f5e76d/test_coverage
19
+ [🔑depfu]: https://depfu.com/github/pboling/rspec-block_is_expected?project_id=5865
20
+ [🔑depfui]: https://badges.depfu.com/badges/79867e590f063376f40b031a1447c215/count.svg
21
+
22
+ -----
23
+
24
+ [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
25
+ [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
26
+
27
+ <span class="badge-buymeacoffee">
28
+ <a href="https://ko-fi.com/O5O86SNP4" target='_blank' title="Donate to my FLOSS or refugee efforts at ko-fi.com"><img src="https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg" alt="Buy me coffee donation button" /></a>
29
+ </span>
30
+ <span class="badge-patreon">
31
+ <a href="https://patreon.com/galtzo" title="Donate to my FLOSS or refugee efforts using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a>
32
+ </span>
33
+
34
+ </div>
35
+
36
+ [⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
37
+ [⛳liberapay]: https://liberapay.com/pboling/donate
38
+ [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
39
+ [🖇sponsor]: https://github.com/sponsors/pboling
40
+
41
+ This gem does ~~five~~, _three sir_, five things.
42
+
43
+ 1. Provides `block_is_expected` to set expectations on the result of running the `subject` as a block.
44
+ 2. Provides, via shared example groups, shortcut RSpec macros for setting an expectation on errors being raised (or not).
45
+ ```ruby
46
+ it_behaves_like "block_is_expected to not raise"
47
+ it_behaves_like "block_is_expected to raise error", RuntimeError
48
+ ```
49
+ 3. Provides RSpec negated matchers that can be used with `block_is_expected`:
50
+ ```ruby
51
+ not_change
52
+ not_raise_error
53
+ ```
54
+ And two others that are so generally useful I end up defining them on every project:
55
+ ```ruby
56
+ not_include
57
+ not_eq
58
+ ```
59
+
60
+ ## Just show me the money
61
+
62
+ First, configure in your rspec helper, or similar:
5
63
  ```ruby
6
- subject { Integer(nil) }
7
- it('raises') { block_is_expected.to raise_error(TypeError) }
8
- ```
9
-
10
- | Project | AnonymousActiveRecord |
11
- |------------------------ | ----------------------- |
12
- | gem name | [rspec-block_is_expected](https://rubygems.org/gems/rspec-block_is_expected) |
13
- | license | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) |
14
- | download rank | [![Downloads Today](https://img.shields.io/gem/rd/rspec-block_is_expected.svg)](https://github.com/pboling/rspec-block_is_expected) |
15
- | version | [![Version](https://img.shields.io/gem/v/rspec-block_is_expected.svg)](https://rubygems.org/gems/rspec-block_is_expected) |
16
- | dependencies | [![Depfu](https://badges.depfu.com/badges/272ce0df3bc6df5cbea9354e2c3b65af/count.svg)](https://depfu.com/github/pboling/rspec-block_is_expected?project_id=5614) |
17
- | continuous integration | [![Build Status](https://travis-ci.org/pboling/rspec-block_is_expected.svg?branch=master)](https://travis-ci.org/pboling/rspec-block_is_expected) |
18
- | test coverage | [![Test Coverage](https://api.codeclimate.com/v1/badges/ca0a12604ecc19f5e76d/test_coverage)](https://codeclimate.com/github/pboling/rspec-block_is_expected/test_coverage) |
19
- | maintainability | [![Maintainability](https://api.codeclimate.com/v1/badges/ca0a12604ecc19f5e76d/maintainability)](https://codeclimate.com/github/pboling/rspec-block_is_expected/maintainability) |
20
- | code triage | [![Open Source Helpers](https://www.codetriage.com/pboling/rspec-block_is_expected/badges/users.svg)](https://www.codetriage.com/pboling/rspec-block_is_expected) |
21
- | homepage | [on Github.com][homepage], [on Railsbling.com][blogpage] |
22
- | documentation | [on RDoc.info][documentation] |
23
- | Spread ~♡ⓛⓞⓥⓔ♡~ | [🌏](https://about.me/peter.boling), [👼](https://angel.co/peter-boling), [:shipit:](http://coderwall.com/pboling), [![Tweet Peter](https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow)](http://twitter.com/galtzo)|
24
-
25
- If you only ever want to test subjects wrapped in blocks, and are comfortable with **losing** the standard `is_expected` behavior, see an alternative to this gem [here](https://github.com/christopheraue/ruby-rspec-is_expected_block/).
64
+ require "rspec/block_is_expected"
65
+ ```
66
+
67
+ Then,
68
+
69
+ 1. Custom expectation on result of subject as block
70
+ ```ruby
71
+ subject { Integer("1") }
72
+ it("raises") { block_is_expected.to(not_raise_error) }
73
+ ```
74
+ 2. Subject will not raise an exception
75
+ ```ruby
76
+ subject { Integer("1") }
77
+ it_behaves_like "block_is_expected to not raise"
78
+ ```
79
+ 3. Subject will raise an exception
80
+ ```ruby
81
+ subject { Integer(nil) }
82
+ it_behaves_like "block_is_expected to raise error", TypeError
83
+ ```
84
+
85
+ | Project | `bundle add rspec-block_is_expected --group test` |
86
+ |--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
87
+ | name, license, docs, standards | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![RubyDoc.info][🚎yard-img]][🚎yard] [![SemVer 2.0.0][🧮semver-img]][🧮semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] |
88
+ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] |
89
+ | dependencies | [![Depfu][🔑depfui]][🔑depfu] |
90
+ | continuous integration | [![CI Build][🚎dl-cwfi]][🚎dl-cwf] [![Heads][🖐hwfi]][🖐hwf] [![Style][🧮swfi]][🧮swf] |
91
+ | test coverage | [![Test Coverage][🔑cc-covi]][🔑cc-cov] |
92
+ | maintainability | [![Maintainability](https://api.codeclimate.com/v1/badges/ca0a12604ecc19f5e76d/maintainability)](https://codeclimate.com/github/pboling/rspec-block_is_expected/maintainability) |
93
+ | code triage | [![Open Source Helpers](https://www.codetriage.com/pboling/rspec-block_is_expected/badges/users.svg)](https://www.codetriage.com/pboling/rspec-block_is_expected) |
94
+ | homepage | [on Github.com][homepage], [on Railsbling.com][blogpage] |
95
+ | documentation | [on RDoc.info][documentation] |
96
+ | `...` 💖 | [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay], [🧊][🧊berg], [🛖][🛖hut], [🧪][🧪lab], [🌏][aboutme], [👼][angellist], [⚗️][devto], [![Tweet @galtzo][followme]][twitter] |
97
+
98
+ <!--
99
+ The link tokens in the following sections should be kept ordered by the row and badge numbering scheme
100
+ -->
101
+
102
+ <!-- 1️⃣ name, license, docs -->
103
+ [⛳️gem]: https://rubygems.org/gems/rspec-block_is_expected
104
+ [⛳️name-img]: https://img.shields.io/badge/name-rspec--block__is__expected-brightgreen.svg?style=flat
105
+ [🖇src-license]: https://opensource.org/licenses/MIT
106
+ [🖇src-license-img]: https://img.shields.io/badge/License-MIT-green.svg
107
+ [🚎yard]: https://www.rubydoc.info/gems/rspec-block_is_expected
108
+ [🚎yard-img]: https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat
109
+ [🧮semver]: http://semver.org/
110
+ [🧮semver-img]: https://img.shields.io/badge/semver-2.0.0-FFDD67.svg?style=flat
111
+ [📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
112
+ [📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-FFDD67.svg?style=flat
113
+
114
+ <!-- 2️⃣ version & activity -->
115
+ [⛳️version-img]: http://img.shields.io/gem/v/rspec-block_is_expected.svg
116
+ [🖇DL-total-img]: https://img.shields.io/gem/dt/rspec-block_is_expected.svg
117
+ [🏘DL-rank-img]: https://img.shields.io/gem/rt/rspec-block_is_expected.svg
118
+
119
+ [🖐hwf]: https://github.com/pboling/rspec-block_is_expected/actions/workflows/heads.yml
120
+ [🖐hwfi]: https://github.com/pboling/rspec-block_is_expected/actions/workflows/heads.yml/badge.svg
121
+ [🧮swf]: https://github.com/pboling/rspec-block_is_expected/actions/workflows/style.yml
122
+ [🧮swfi]: https://github.com/pboling/rspec-block_is_expected/actions/workflows/style.yml/badge.svg
123
+
124
+ If you only _ever_ want to test subjects wrapped in blocks, and are comfortable with **losing** the standard `is_expected` behavior, see an alternative to this gem [here](https://github.com/christopheraue/ruby-rspec-is_expected_block/).
125
+
126
+ ## Ruby Compatibility
127
+ Supports the same versions of Ruby that RSpec does, 1.8.7 - current ruby-head,
128
+ as well as the JRuby equivalents.
26
129
 
27
130
  ## Installation
28
131
 
29
132
  Add this line to your application's Gemfile:
30
133
 
31
134
  ```ruby
32
- gem 'rspec-block_is_expected', :group => :test
135
+ gem "rspec-block_is_expected", :group => :test
33
136
  ```
34
137
 
35
138
  And then execute:
@@ -46,7 +149,7 @@ There is no configuration needed if you your test suite loads the bundle group (
46
149
 
47
150
  Otherwise, you may load it manually near the top of your `spec_helper.rb`, and it will self configure.
48
151
  ```ruby
49
- require 'rspec/block_is_expected'
152
+ require "rspec/block_is_expected"
50
153
  ```
51
154
 
52
155
  ### RSpec Matchers
@@ -56,15 +159,15 @@ but `to_not` doesn't work with multiple expectations.
56
159
  So negated matchers are required. A basic set of them are included with this gem, and can be loaded with:
57
160
 
58
161
  ```ruby
59
- require 'rspec/block_is_expected/matchers/not'
162
+ require "rspec/block_is_expected/matchers/not"
60
163
  ```
61
164
 
62
165
  This gives you the following matchers:
63
166
  ```ruby
64
- RSpec::Matchers.define_negated_matcher :not_change, :change
65
- RSpec::Matchers.define_negated_matcher :not_include, :include
66
- RSpec::Matchers.define_negated_matcher :not_eq, :eq
67
- RSpec::Matchers.define_negated_matcher :not_raise_error, :raise_error
167
+ RSpec::Matchers.define_negated_matcher(:not_change, :change)
168
+ RSpec::Matchers.define_negated_matcher(:not_include, :include)
169
+ RSpec::Matchers.define_negated_matcher(:not_eq, :eq)
170
+ RSpec::Matchers.define_negated_matcher(:not_raise_error, :raise_error)
68
171
  ```
69
172
 
70
173
  #### Example
@@ -72,28 +175,28 @@ RSpec::Matchers.define_negated_matcher :not_raise_error, :raise_error
72
175
  You have a module like this:
73
176
 
74
177
  ```ruby
75
- module MyTasks
76
- def my_rakelib
77
- Rake.add_rakelib('bananas')
78
- end
79
- module_function :my_rakelib
80
- end
178
+ module MyTasks
179
+ def my_rakelib
180
+ Rake.add_rakelib("bananas")
181
+ end
182
+ module_function :my_rakelib
183
+ end
81
184
  ```
82
185
 
83
186
  You have a spec like this:
84
187
 
85
188
  ```ruby
86
- require 'rake'
87
-
88
- RSpec.describe(MyTasks) do
89
- describe 'my_rakelib' do
90
- subject(:my_rakelib) { described_class.my_rakelib }
91
- it 'updates rakelib' do
92
- block_is_expected.to not_raise_error &
93
- change { Rake.application.options.rakelib }.from(['rakelib']).to(%w[rakelib bananas])
189
+ require "rake"
190
+
191
+ RSpec.describe(MyTasks) do
192
+ describe "my_rakelib" do
193
+ subject(:my_rakelib) { described_class.my_rakelib }
194
+ it "updates rakelib" do
195
+ block_is_expected.to(not_raise_error &
196
+ change { Rake.application.options.rakelib }.from(["rakelib"]).to(%w[rakelib bananas]))
197
+ end
198
+ end
94
199
  end
95
- end
96
- end
97
200
  ```
98
201
 
99
202
  ### Integration with RuboCop
@@ -115,36 +218,46 @@ inherit_gem:
115
218
  The spec suite for this gem has some examples of usage, lightly edited here.
116
219
 
117
220
  ```ruby
118
- RSpec.describe 'TestyMcTest' do
119
- context 'errors raised' do
120
- subject { Integer(nil) }
121
- it('can be tested') do
122
- # Where you used to have:
123
- # expect { subject }.to raise_error(TypeError)
124
- block_is_expected.to raise_error(TypeError)
125
- end
126
- end
127
- context 'execution' do
128
- let(:mutex) { Mutex.new }
129
- subject { mutex.lock }
130
- it('can change state') do
131
- expect(mutex.locked?).to eq(false)
132
- # Where you used to have:
133
- # expect { subject }.to_not raise_error
134
- block_is_expected.to_not raise_error
135
- expect(mutex.locked?).to eq(true)
136
- end
137
- end
138
- context 'changed state' do
139
- let(:mutex) { Mutex.new }
140
- subject { mutex.lock }
141
- it('can be tested') do
142
- # Where you used to have:
143
- # expect { subject }.to change { mutex.locked? }.from(false).to(true)
144
- block_is_expected.to change { mutex.locked? }.from(false).to(true)
221
+ RSpec.describe("TestyMcTest") do
222
+ context "errors raised" do
223
+ subject { Integer(nil) }
224
+ it("can be tested") do
225
+ # Where you used to have:
226
+ # expect { subject }.to raise_error(TypeError)
227
+ block_is_expected.to(raise_error(TypeError))
228
+ end
229
+ end
230
+ context "execution" do
231
+ let(:mutex) { Mutex.new }
232
+ subject { mutex.lock }
233
+ it("can change state") do
234
+ expect(mutex.locked?).to(eq(false))
235
+ # Where you used to have:
236
+ # expect { subject }.to_not raise_error
237
+ block_is_expected.to_not(raise_error)
238
+ expect(mutex.locked?).to(eq(true))
239
+ end
240
+ end
241
+ context "changed state" do
242
+ let(:mutex) { Mutex.new }
243
+ subject { mutex.lock }
244
+ it("can be tested") do
245
+ # Where you used to have:
246
+ # expect { subject }.to change { mutex.locked? }.from(false).to(true)
247
+ block_is_expected.to(change { mutex.locked? }.from(false).to(true))
248
+ end
249
+ end
145
250
  end
146
- end
147
- end
251
+ ```
252
+
253
+ ## Switch to `main` branch
254
+
255
+ We recently migrated from `master` to `main` as the default branch. If this affected your local checkout:
256
+ ```shell
257
+ git branch -m master main
258
+ git fetch origin
259
+ git branch -u origin/main main
260
+ git remote set-head origin -a
148
261
  ```
149
262
 
150
263
  ## Development
@@ -155,26 +268,40 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
155
268
 
156
269
  ## Authors
157
270
 
158
- [Peter H. Boling][peterboling] of [Rails Bling][railsbling] is the author.
271
+ * [Peter H. Boling][peterboling] of [Rails Bling][railsbling] is the author.
159
272
 
160
- ## Contributors
273
+ ## Contributing
161
274
 
162
- See the [Network View](https://github.com/pboling/rspec-block_is_expected/network) and the [CHANGELOG](https://github.com/pboling/rspec-block_is_expected/blob/master/CHANGELOG.md)
275
+ See [CONTRIBUTING.md][contributing].
276
+ [contributing]: https://gitlab.com/pboling/rspec-block_is_expected/-/blob/main/CONTRIBUTING.md
163
277
 
164
278
  ## Contributing
165
279
 
166
- 1. Fork it
167
- 2. Create your feature branch (`git checkout -b my-new-feature`)
168
- 3. Commit your changes (`git commit -am 'Added some feature'`)
169
- 4. Push to the branch (`git push origin my-new-feature`)
170
- 5. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
171
- 6. Create new Pull Request
280
+ See [CONTRIBUTING.md][contributing].
281
+ [contributing]: https://gitlab.com/pboling/rspec-stubbed_env/-/blob/main/CONTRIBUTING.md
282
+
283
+ ### Running Specs
284
+
285
+ The basic compatibility matrix:
286
+ ```sh
287
+ appraisal install
288
+ appraisal rake test
289
+ ```
290
+
291
+ Sometimes also:
292
+ ```sh
293
+ BUNDLE_GEMFILE=gemfiles/vanilla.gemfile appraisal update
294
+ ```
295
+
296
+ NOTE: This results in bad paths to the gemspec.
297
+ `gemspec path: "../../"` needs to be replaced with `gemspec :path => "../"` in each Appraisal gemfile.
172
298
 
173
- Bug reports and pull requests are welcome on GitHub at https://github.com/pboling/anonymous_active_record. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
299
+ Except, is unlikely to be possible to install all of the supported Rubies & Railsies in a single container...
300
+ See the various github action workflows for more inspiration on running certain oldies.
174
301
 
175
302
  ## Code of Conduct
176
303
 
177
- Everyone interacting in the AnonymousActiveRecord project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pboling/anonymous_active_record/blob/master/CODE_OF_CONDUCT.md).
304
+ Everyone interacting in the AnonymousActiveRecord project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct][conduct].
178
305
 
179
306
  ## Versioning
180
307
 
@@ -190,29 +317,39 @@ dependency on this gem using the [Pessimistic Version Constraint][pvc] with two
190
317
 
191
318
  For example in a `Gemfile`:
192
319
 
193
- gem 'rspec-block_is_expected', '~> 1.0', group: :test
320
+ ```ruby
321
+ gem "rspec-block_is_expected", "~> 1.0", :group => [:development, :test]
322
+ ```
194
323
 
195
324
  or in a `gemspec`
196
325
 
197
- spec.add_development_dependency 'rspec-block_is_expected', '~> 1.0'
326
+ ```ruby
327
+ spec.add_development_dependency("rspec-block_is_expected", "~> 1.0")
328
+ ```
198
329
 
199
330
  ## Legal
200
331
 
201
- * MIT License - See [LICENSE][license] file in this project [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
332
+ * Copyright © 2018, 2020, 2023 - 2024 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
202
333
 
203
- * Copyright (c) 2018, 2020, 2023 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
334
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
204
335
 
205
- [semver]: http://semver.org/
206
- [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
336
+ [aboutme]: https://about.me/peter.boling
337
+ [angellist]: https://angel.co/peter-boling
338
+ [blogpage]: http://www.railsbling.com/tags/rspec-block_is_expected/
339
+ [conduct]: CODE_OF_CONDUCT.md
340
+ [contributing]: CONTRIBUTING.md
341
+ [devto]: https://dev.to/galtzo
207
342
  [documentation]: http://rdoc.info/github/pboling/rspec-block_is_expected/frames
343
+ [followme]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
208
344
  [homepage]: https://github.com/pboling/rspec-block_is_expected
209
- [blogpage]: http://www.railsbling.com/tags/rspec-block_is_expected/
210
- [license]: LICENSE
211
- [railsbling]: http://www.railsbling.com
345
+ [license]: LICENSE.txt
212
346
  [peterboling]: https://about.me/peter.boling
213
- [refugees]: https://www.crowdrise.com/helprefugeeswithhopefortomorrowliberia/fundraiser/peterboling
214
- [gplus]: https://plus.google.com/+PeterBoling/posts
215
- [topcoder]: https://www.topcoder.com/members/pboling/
216
- [angellist]: https://angel.co/peter-boling
217
- [coderwall]: http://coderwall.com/pboling
347
+ [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
348
+ [railsbling]: http://www.railsbling.com
349
+ [semver]: http://semver.org/
218
350
  [twitter]: http://twitter.com/galtzo
351
+ [🧊berg]: https://codeberg.org/pboling
352
+ [🛖hut]: https://sr.ht/~galtzo/
353
+ [🧪lab]: https://gitlab.com/pboling
354
+ [⛳liberapay]: https://liberapay.com/pboling/donate
355
+ [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay
data/SECURITY.md ADDED
@@ -0,0 +1,13 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ |----------|-----------|
7
+ | 1.latest | ✅ |
8
+
9
+ ## Reporting a Vulnerability
10
+
11
+ Peter Boling is the primary maintainer of this gem. Please find a way
12
+ to [contact him directly](https://railsbling.com/contact) to report the issue. Include as much relevant information as
13
+ possible.
@@ -1,4 +1,4 @@
1
- RSpec::Matchers.define_negated_matcher :not_change, :change
2
- RSpec::Matchers.define_negated_matcher :not_include, :include
3
- RSpec::Matchers.define_negated_matcher :not_eq, :eq
4
- RSpec::Matchers.define_negated_matcher :not_raise_error, :raise_error
1
+ RSpec::Matchers.define_negated_matcher(:not_change, :change)
2
+ RSpec::Matchers.define_negated_matcher(:not_include, :include)
3
+ RSpec::Matchers.define_negated_matcher(:not_eq, :eq)
4
+ RSpec::Matchers.define_negated_matcher(:not_raise_error, :raise_error)
@@ -1,8 +1,8 @@
1
- require 'rspec/core'
2
- begin
3
- RSpec.configure do |c|
4
- c.include Rspec::BlockIsExpected
5
- end
6
- rescue NameError
7
- # Rspec really should be loaded by now...
1
+ require "rspec/core"
2
+ require "rspec/block_is_expected/matchers/not"
3
+
4
+ RSpec.configure do |c|
5
+ c.include(Rspec::BlockIsExpected)
8
6
  end
7
+ require "rspec/block_is_expected/shared_examples/block_does_not_raise_examples"
8
+ require "rspec/block_is_expected/shared_examples/block_raises_error_examples"
@@ -0,0 +1,5 @@
1
+ RSpec.shared_examples_for("block_is_expected to not raise") do
2
+ it "does not raise error" do
3
+ block_is_expected.not_to(raise_error)
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.shared_examples_for("block_is_expected to raise error") do |*error_args|
2
+ it "raises error #{error_args.inspect}" do
3
+ block_is_expected.to(raise_error(*error_args))
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module BlockIsExpected
3
- VERSION = '1.0.4'.freeze
3
+ VERSION = "1.0.6".freeze
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
- require 'rspec/block_is_expected/version'
2
- require 'rspec/block_is_expected/rspec'
1
+ require "rspec/block_is_expected/version"
2
+ require "rspec/block_is_expected/rspec"
3
3
 
4
4
  module Rspec
5
5
  # Namespace of this library
data.tar.gz.sig ADDED
Binary file