dryspec 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.rubocop.yml +52 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Guardfile +66 -0
- data/LICENSE.txt +21 -0
- data/README.md +95 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/dryspec.gemspec +32 -0
- data/lib/dryspec.rb +5 -0
- data/lib/dryspec/helpers.rb +104 -0
- data/lib/dryspec/version.rb +3 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 86d5786cc24a5f8ff16e60a244b370d657356106
|
4
|
+
data.tar.gz: fcb9867e8779b528ad8452f48a1da114381956cb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d73cd73b915be44f1f42f64f735cf6668b66fa836b2142dfd76637849756c6d4ef4bc8d7b77351215c41796b5b07fd9b5ecf907cfc8a24065dadee2cb7ac3486
|
7
|
+
data.tar.gz: df876741d6edd5cea736e2598b6c922c6f40ae324d1bd5c63f29a0a21ffb75d25f7542350056e43093a6576362370eb2e77af62515c6abc240d5e6103ab43af9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
|
4
|
+
Style/MultilineBlockChain:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Metrics/ModuleLength:
|
8
|
+
Exclude:
|
9
|
+
- 'spec/**/*'
|
10
|
+
|
11
|
+
Metrics/LineLength:
|
12
|
+
Max: 112
|
13
|
+
Exclude:
|
14
|
+
- 'spec/**/*'
|
15
|
+
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Exclude:
|
18
|
+
- Guardfile
|
19
|
+
- 'spec/**/*'
|
20
|
+
|
21
|
+
Style/Documentation:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Lint/HandleExceptions:
|
25
|
+
Exclude:
|
26
|
+
- 'spec/**/*'
|
27
|
+
|
28
|
+
# Brian has very strong opinions on this one. See:
|
29
|
+
# https://github.com/bbatsov/ruby-style-guide/issues/329
|
30
|
+
# https://github.com/bbatsov/ruby-style-guide/pull/325
|
31
|
+
Style/NegatedIf:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/SignalException:
|
35
|
+
EnforcedStyle: semantic
|
36
|
+
|
37
|
+
Style/FrozenStringLiteralComment:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Performance/Casecmp:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
# Special characters in comments is a fundamental human right
|
44
|
+
Style/AsciiComments:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
Style/SingleLineBlockParams:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Lint/ShadowingOuterLocalVariable:
|
51
|
+
Enabled: false
|
52
|
+
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at brian.underwood@teamnorthwoods.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
guard :rubocop, cli: '--auto-correct --display-cop-names --except Lint/Debugger' do
|
2
|
+
watch(/.+\.rb$/)
|
3
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
4
|
+
|
5
|
+
callback(:start_begin) { puts '👮 🚨 👮 🚨 👮 🚨 👮 🚨 👮' }
|
6
|
+
end
|
7
|
+
|
8
|
+
guard 'yard' do
|
9
|
+
watch(%r{app\/.+\.rb})
|
10
|
+
watch(%r{lib\/.+\.rb})
|
11
|
+
watch(%r{ext\/.+\.c})
|
12
|
+
end
|
13
|
+
|
14
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
15
|
+
# rspec may be run, below are examples of the most common uses.
|
16
|
+
# * bundler: 'bundle exec rspec'
|
17
|
+
# * bundler binstubs: 'bin/rspec'
|
18
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
19
|
+
# installed the spring binstubs per the docs)
|
20
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
21
|
+
# * 'just' rspec: 'rspec'
|
22
|
+
|
23
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
24
|
+
require 'guard/rspec/dsl'
|
25
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
26
|
+
|
27
|
+
# Feel free to open issues for suggestions and improvements
|
28
|
+
|
29
|
+
# RSpec files
|
30
|
+
rspec = dsl.rspec
|
31
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
32
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
33
|
+
watch(rspec.spec_files)
|
34
|
+
|
35
|
+
# Ruby files
|
36
|
+
ruby = dsl.ruby
|
37
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
38
|
+
|
39
|
+
# Rails files
|
40
|
+
rails = dsl.rails(view_extensions: %w[erb haml slim])
|
41
|
+
dsl.watch_spec_files_for(rails.app_files)
|
42
|
+
dsl.watch_spec_files_for(rails.views)
|
43
|
+
|
44
|
+
watch(rails.controllers) do |m|
|
45
|
+
[
|
46
|
+
rspec.spec.call("routing/#{m[1]}_routing"),
|
47
|
+
rspec.spec.call("controllers/#{m[1]}_controller"),
|
48
|
+
rspec.spec.call("acceptance/#{m[1]}")
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
# Rails config changes
|
53
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
54
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
55
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
56
|
+
|
57
|
+
# Capybara features specs
|
58
|
+
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
|
59
|
+
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
|
60
|
+
|
61
|
+
# Turnip features and steps
|
62
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
63
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
64
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance'
|
65
|
+
end
|
66
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Brian Underwood
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
# DRYSpec
|
2
|
+
|
3
|
+
DRYSpec introduces the `let_context`, `subject_should_raise`, and `subject_should_not_raise` helpers into RSpec which can allow you to have shorter, easier to read spec files.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'dryspec'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install dryspec
|
20
|
+
|
21
|
+
Then add `config.extend DRYSpec::Helpers` to your RSpec configuration like so:
|
22
|
+
|
23
|
+
RSpec.configure do |config|
|
24
|
+
# ... configuration ...
|
25
|
+
|
26
|
+
config.extend DRYSpec::Helpers
|
27
|
+
|
28
|
+
# ... configuration ...
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
### `let_context`
|
33
|
+
|
34
|
+
The `let_context` helper allows you to easily create a `context` block with one or more `let` variables like so:
|
35
|
+
|
36
|
+
# Before
|
37
|
+
context 'The foo is 1' do
|
38
|
+
let(:foo) { 1 }
|
39
|
+
end
|
40
|
+
|
41
|
+
# After
|
42
|
+
let_context foo: 1 do
|
43
|
+
end
|
44
|
+
|
45
|
+
In some cases, this case even allow you to have one line per example. For example, let's say you were testing an `#add_two` method. You could do:
|
46
|
+
|
47
|
+
subject { add_two(value) }
|
48
|
+
|
49
|
+
let_context(value: 10) { it { should eq 12 } }
|
50
|
+
let_context(value: 1) { it { should eq 3 } }
|
51
|
+
let_context(value: 0) { it { should eq 2 } }
|
52
|
+
|
53
|
+
By default when you give `let_context` a `Hash`, the `#inspect` of the `Hash` becomes the description for your example which you see in your test output. If you'd like something more specific you can add a string like so:
|
54
|
+
|
55
|
+
let_context('Negative number', value: -1) { it { should eq 1 } }
|
56
|
+
let_context('Big negative number', value: -10) { it { should eq -8 } }
|
57
|
+
|
58
|
+
### `subject_should_(not_)raise`
|
59
|
+
|
60
|
+
The `subject_should_raise` and `subject_should_not_raise` are simply helpers which allow you to create an RSpec example which asserts if the subject of your tests will raise an exception. For example:
|
61
|
+
|
62
|
+
# Before
|
63
|
+
subject { fail 'Test' }
|
64
|
+
it "should raise 'Test'" do
|
65
|
+
expect { subject }.to raise_error 'Test'
|
66
|
+
end
|
67
|
+
|
68
|
+
# After
|
69
|
+
subject { fail 'Test' }
|
70
|
+
subject_should_raise 'Test'
|
71
|
+
|
72
|
+
There is also a `subject_should_not_raise`:
|
73
|
+
|
74
|
+
subject { 1 }
|
75
|
+
subject_should_not_raise
|
76
|
+
|
77
|
+
## Documentation
|
78
|
+
|
79
|
+
See [the documentation](TODO) for more details
|
80
|
+
|
81
|
+
## Development
|
82
|
+
|
83
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
84
|
+
|
85
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
86
|
+
|
87
|
+
## Contributing
|
88
|
+
|
89
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/northwoodspd/dryspec. 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.
|
90
|
+
|
91
|
+
|
92
|
+
## License
|
93
|
+
|
94
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
95
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'dryspec'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/dryspec.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'dryspec/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'dryspec'
|
9
|
+
spec.version = DRYSpec::VERSION
|
10
|
+
spec.authors = ['Team Northwoods']
|
11
|
+
spec.email = ['brian.underwood@teamnorthwoods.com']
|
12
|
+
|
13
|
+
spec.summary = 'A Ruby gem to introduce RSpec helpers which can help you DRY up your specs'
|
14
|
+
spec.description = 'A Ruby gem to introduce RSpec helpers which can help you DRY up your specs'
|
15
|
+
spec.homepage = 'https://github.com/northwoodspd/dryspec'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features)/})
|
20
|
+
end
|
21
|
+
spec.bindir = 'exe'
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.14'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
+
spec.add_development_dependency 'guard-rubocop', '~> 1.2.0'
|
29
|
+
spec.add_development_dependency 'yard', '~> 0.9.9'
|
30
|
+
spec.add_development_dependency 'guard-yard', '~> 2.2.0'
|
31
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7.3'
|
32
|
+
end
|
data/lib/dryspec.rb
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
module DRYSpec
|
2
|
+
module Helpers
|
3
|
+
# This allows us to simplify the case where we want to
|
4
|
+
# have a context which contains one or more `let` statements
|
5
|
+
#
|
6
|
+
# Supports giving either a Hash or a String and a Hash as arguments
|
7
|
+
# In both cases the Hash will be used to define `let` statements
|
8
|
+
# When a String is specified that becomes the context description
|
9
|
+
# If String isn't specified, Hash#inspect becomes the context description
|
10
|
+
#
|
11
|
+
# @example Defining a simple let variable
|
12
|
+
# # Before
|
13
|
+
# subject { a + 1 }
|
14
|
+
# context('a is 1') do
|
15
|
+
# let(:a) { 1 }
|
16
|
+
# it { should eq 2 }
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# # After
|
20
|
+
# subject { a + 1 }
|
21
|
+
# let_context(a: 1) { it { should eq 2 } }
|
22
|
+
#
|
23
|
+
# @example Giving a descriptive string
|
24
|
+
# subject { a + 1 }
|
25
|
+
# let_context('Negative number', a: -1) { it { should eq 0 } }
|
26
|
+
#
|
27
|
+
# @example Multiple variables
|
28
|
+
# subject { a + b }
|
29
|
+
# let_context(a: 1, b: 2) { it { should eq 3 } }
|
30
|
+
def let_context(*args, &block)
|
31
|
+
context_string, hash =
|
32
|
+
case args.map(&:class)
|
33
|
+
when [String, Hash] then ["#{args[0]} #{args[1]}", args[1]]
|
34
|
+
when [Hash] then [args[0].inspect, args[0]]
|
35
|
+
end
|
36
|
+
|
37
|
+
context(context_string) do
|
38
|
+
hash.each { |var, value| let(var) { value } }
|
39
|
+
|
40
|
+
instance_eval(&block)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Allows you to simply specify that the subject should raise an exception
|
45
|
+
# Takes no arguments or arguments of an exception class, a string, or both.
|
46
|
+
#
|
47
|
+
# As with RSpec's basic `to raise_error` matcher, if you don't give an error
|
48
|
+
# then the an unexpected error may cause your test to pass incorrectly
|
49
|
+
#
|
50
|
+
# @example Raising a string
|
51
|
+
# # Before
|
52
|
+
# subject { fail 'Test' }
|
53
|
+
# it "should raise 'Test'" do
|
54
|
+
# expect { subject }.to raise_error 'Test'
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# # After
|
58
|
+
# subject { fail 'Test' }
|
59
|
+
# subject_should_raise 'Test'
|
60
|
+
#
|
61
|
+
# @example Raising an exception class
|
62
|
+
# subject { fail ArgumentError }
|
63
|
+
# subject_should_raise ArgumentError
|
64
|
+
#
|
65
|
+
# @example Raising an exception class and string
|
66
|
+
# subject { fail ArgumentError, 'Test' }
|
67
|
+
# subject_should_raise ArgumentError, 'Test'
|
68
|
+
def subject_should_raise(*args)
|
69
|
+
error, message = args
|
70
|
+
it_string = "subject should raise #{error}"
|
71
|
+
it_string += " (#{message.inspect})" if message
|
72
|
+
|
73
|
+
it it_string do
|
74
|
+
expect { subject }.to raise_error error, message
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Allows you to simply specify that the subject should not raise an exception.
|
79
|
+
# Takes no arguments or arguments of an exception class, a string, or both.
|
80
|
+
#
|
81
|
+
# As with RSpec's basic `not_to raise_error` matcher, if you give a specific error, other
|
82
|
+
# unexpected errors may be swallowed silently
|
83
|
+
#
|
84
|
+
# @example Subject does not raise an error
|
85
|
+
# # Before
|
86
|
+
# subject { 1 }
|
87
|
+
# it 'should not raise an exception' do
|
88
|
+
# expect { subject }.not_to raise_error
|
89
|
+
# end
|
90
|
+
#
|
91
|
+
# # After
|
92
|
+
# subject { 1 }
|
93
|
+
# subject_should_not_raise
|
94
|
+
def subject_should_not_raise(*args)
|
95
|
+
error, message = args
|
96
|
+
it_string = "subject should not raise #{error}"
|
97
|
+
it_string += " (#{message.inspect})" if message
|
98
|
+
|
99
|
+
it it_string do
|
100
|
+
expect { subject }.not_to raise_error error, message
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dryspec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Team Northwoods
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: guard-rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.2.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.2.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.9.9
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.9.9
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.2.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.2.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 4.7.3
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 4.7.3
|
111
|
+
description: A Ruby gem to introduce RSpec helpers which can help you DRY up your
|
112
|
+
specs
|
113
|
+
email:
|
114
|
+
- brian.underwood@teamnorthwoods.com
|
115
|
+
executables: []
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- ".travis.yml"
|
123
|
+
- CODE_OF_CONDUCT.md
|
124
|
+
- Gemfile
|
125
|
+
- Guardfile
|
126
|
+
- LICENSE.txt
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- bin/console
|
130
|
+
- bin/setup
|
131
|
+
- dryspec.gemspec
|
132
|
+
- lib/dryspec.rb
|
133
|
+
- lib/dryspec/helpers.rb
|
134
|
+
- lib/dryspec/version.rb
|
135
|
+
homepage: https://github.com/northwoodspd/dryspec
|
136
|
+
licenses:
|
137
|
+
- MIT
|
138
|
+
metadata: {}
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
require_paths:
|
142
|
+
- lib
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
requirements: []
|
154
|
+
rubyforge_project:
|
155
|
+
rubygems_version: 2.6.8
|
156
|
+
signing_key:
|
157
|
+
specification_version: 4
|
158
|
+
summary: A Ruby gem to introduce RSpec helpers which can help you DRY up your specs
|
159
|
+
test_files: []
|