rspec-preconditions 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8d449cf8c574fb74156bf31baf1b16a25f211cf0
4
+ data.tar.gz: ce47a14e7bc364b4e1b7a0da8765269934bbcb4a
5
+ SHA512:
6
+ metadata.gz: 47140294db103e82539ec2480a7e42184b346c28abe6e2663cb7fbca7a4922b289c4a1d9cbf9b3c6f795792274928377dc58606029792a8c06512b7e3cc1b869
7
+ data.tar.gz: 8ae57e37d959ea9cfe03b45c0269463d7d46cb03b273c1e3395ec90c2719e8483e4cc112b4d4ced24fc04a339defcc698172f557001f3636b92b690410b8799f
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ spec/examples.txt
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,27 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ DisplayStyleGuide: true
4
+ EnabledByDefault: true
5
+ ExtraDetails: true
6
+
7
+ Style/Copyright:
8
+ Enabled: false
9
+
10
+ Style/Documentation:
11
+ Enabled: false
12
+
13
+ Style/DocumentationMethod:
14
+ Enabled: false
15
+
16
+ Style/FileName:
17
+ Exclude:
18
+ - Appraisals
19
+
20
+ Style/InlineComment:
21
+ Enabled: false
22
+
23
+ Style/MethodCallWithArgsParentheses:
24
+ Enabled: false
25
+
26
+ Style/MissingElse:
27
+ Enabled: false
@@ -0,0 +1,6 @@
1
+ SimpleCov.start do
2
+ load_profile "test_frameworks"
3
+
4
+ track_files "lib/**/*.rb"
5
+ add_filter "lib/rspec/preconditions/version.rb"
6
+ end
@@ -0,0 +1,20 @@
1
+ cache: bundler
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.4
6
+ - 2.2.1
7
+ - 2.3.0
8
+ - jruby-1.7.22
9
+ - jruby-9.0.0.0.pre1
10
+ gemfile:
11
+ - gemfiles/rspec-3.0.gemfile
12
+ - gemfiles/rspec-3.1.gemfile
13
+ - gemfiles/rspec-3.2.gemfile
14
+ - gemfiles/rspec-3.3.gemfile
15
+ - gemfiles/rspec-3.4.gemfile
16
+ - gemfiles/rspec-3.5.gemfile
17
+ before_install:
18
+ - rvm @global do gem install bundler
19
+ - rvm @global do bundle install
20
+ script: bundle exec rake
@@ -0,0 +1,34 @@
1
+ appraise 'rspec-3.0' do
2
+ gem 'rspec-core', '~> 3.0.0'
3
+ gem 'rspec-expectations', '~> 3.0.0'
4
+ end
5
+
6
+ appraise 'rspec-3.1' do
7
+ gem 'rspec-core', '~> 3.1.0'
8
+ gem 'rspec-expectations', '~> 3.1.0'
9
+ end
10
+
11
+ appraise 'rspec-3.2' do
12
+ gem 'rspec-core', '~> 3.2.0'
13
+ gem 'rspec-expectations', '~> 3.2.0'
14
+ end
15
+
16
+ appraise 'rspec-3.3' do
17
+ gem 'rspec-core', '~> 3.3.0'
18
+ gem 'rspec-expectations', '~> 3.3.0'
19
+ end
20
+
21
+ appraise 'rspec-3.4' do
22
+ gem 'rspec-core', '~> 3.4.0'
23
+ gem 'rspec-expectations', '~> 3.4.0'
24
+ end
25
+
26
+ appraise 'rspec-3.5' do
27
+ gem 'rspec-core', '~> 3.5.0'
28
+ gem 'rspec-expectations', '~> 3.5.0'
29
+ end
30
+
31
+ appraise 'rspec-3.6' do
32
+ gem 'rspec-core', '~> 3.6.0.beta2'
33
+ gem 'rspec-expectations', '~> 3.6.0.beta2'
34
+ end
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'appraisal'
6
+ gem 'rubocop'
7
+ gem 'simplecov'
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Isaac Betesh
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.
@@ -0,0 +1,92 @@
1
+ [![Gem Version](https://badge.fury.io/rb/rspec-preconditions.svg)](https://badge.fury.io/rb/rspec-preconditions)
2
+ [![Build Status](https://secure.travis-ci.org/on-site/rspec-preconditions.svg?branch=master)](http://travis-ci.org/on-site/rspec-preconditions)
3
+
4
+ # RSpec::Preconditions
5
+
6
+ Sometimes every example in an RSpec example group fails because of a bug in the before hook.
7
+
8
+ Wouldn't you rather see the error only once, rather than for every single example?
9
+
10
+ Now you can!
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'rspec-preconditions'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install rspec-preconditions
27
+
28
+ ## Usage
29
+
30
+ We've all written tests like this:
31
+
32
+ ```
33
+ RSpec.describe Array do
34
+ subject { [1, 'A', nil] }
35
+
36
+ before(:each) do
37
+ subject.sort!
38
+ end
39
+
40
+ it 'still contains 1 after sorting' do
41
+ expect(subject).to include(1)
42
+ end
43
+
44
+ it 'still contains "A" after sorting' do
45
+ expect(subject).to include('A')
46
+ end
47
+
48
+ it 'still contains nil after sorting' do
49
+ expect(subject).to include(nil)
50
+ end
51
+ end
52
+ ```
53
+
54
+ And as long as the setup code doesn't raise any Exceptions, it works great!
55
+
56
+ The problem is, sometimes the setup code does raise Exceptions--and not just one Exception, but the same Exception for every example in the group!
57
+
58
+ Wouldn't it be nice if you could see just one failed test at the end? After all, there's only one bug that you need to diagnose.
59
+
60
+ Now you can, with just one change:
61
+
62
+ ```
63
+ before(:each) do
64
+ subject.sort!
65
+ end
66
+ ```
67
+
68
+ becomes:
69
+
70
+ ```
71
+ preconditions do
72
+ subject.sort!
73
+ end
74
+ ```
75
+
76
+ Now, if it fails, then you only see one failed test. The rest of the test that show an identical failure are listed as pending.
77
+
78
+ Nice!
79
+
80
+ ## Development
81
+
82
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
83
+
84
+ 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).
85
+
86
+ ## Contributing
87
+
88
+ Bug reports and pull requests are welcome on GitHub at https://github.com/on-site/rspec-preconditions.
89
+
90
+ ## License
91
+
92
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rubocop/rake_task'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RuboCop::RakeTask.new
6
+ RSpec::Core::RakeTask.new
7
+
8
+ task spec: :rubocop
9
+ task default: :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'rspec/preconditions'
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
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.0.0"
9
+ gem "rspec-expectations", "~> 3.0.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.0.4)
25
+ rspec-support (~> 3.0.0)
26
+ rspec-expectations (3.0.4)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.0.0)
29
+ rspec-support (3.0.4)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.0.0)
53
+ rspec-expectations (~> 3.0.0)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.1.0"
9
+ gem "rspec-expectations", "~> 3.1.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.1.7)
25
+ rspec-support (~> 3.1.0)
26
+ rspec-expectations (3.1.2)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.1.0)
29
+ rspec-support (3.1.2)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.1.0)
53
+ rspec-expectations (~> 3.1.0)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.2.0"
9
+ gem "rspec-expectations", "~> 3.2.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.2.3)
25
+ rspec-support (~> 3.2.0)
26
+ rspec-expectations (3.2.1)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.2.0)
29
+ rspec-support (3.2.2)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.2.0)
53
+ rspec-expectations (~> 3.2.0)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.3.0"
9
+ gem "rspec-expectations", "~> 3.3.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.3.2)
25
+ rspec-support (~> 3.3.0)
26
+ rspec-expectations (3.3.1)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.3.0)
29
+ rspec-support (3.3.0)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.3.0)
53
+ rspec-expectations (~> 3.3.0)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.4.0"
9
+ gem "rspec-expectations", "~> 3.4.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.4.4)
25
+ rspec-support (~> 3.4.0)
26
+ rspec-expectations (3.4.0)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.4.0)
29
+ rspec-support (3.4.1)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.4.0)
53
+ rspec-expectations (~> 3.4.0)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.5.0"
9
+ gem "rspec-expectations", "~> 3.5.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.5.4)
25
+ rspec-support (~> 3.5.0)
26
+ rspec-expectations (3.5.0)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.5.0)
29
+ rspec-support (3.5.0)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.5.0)
53
+ rspec-expectations (~> 3.5.0)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "rubocop"
7
+ gem "simplecov"
8
+ gem "rspec-core", "~> 3.6.0.beta2"
9
+ gem "rspec-expectations", "~> 3.6.0.beta2"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,59 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ rspec-preconditions (0.1.0)
5
+ rspec-core
6
+ rspec-expectations
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ appraisal (2.1.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (2.3.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ json (2.0.3)
19
+ parser (2.4.0.0)
20
+ ast (~> 2.2)
21
+ powerpack (0.1.1)
22
+ rainbow (2.2.1)
23
+ rake (10.5.0)
24
+ rspec-core (3.6.0.beta2)
25
+ rspec-support (= 3.6.0.beta2)
26
+ rspec-expectations (3.6.0.beta2)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (= 3.6.0.beta2)
29
+ rspec-support (3.6.0.beta2)
30
+ rubocop (0.48.0)
31
+ parser (>= 2.3.3.1, < 3.0)
32
+ powerpack (~> 0.1)
33
+ rainbow (>= 1.99.1, < 3.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (~> 1.0, >= 1.0.1)
36
+ ruby-progressbar (1.8.1)
37
+ simplecov (0.14.1)
38
+ docile (~> 1.1.0)
39
+ json (>= 1.8, < 3)
40
+ simplecov-html (~> 0.10.0)
41
+ simplecov-html (0.10.0)
42
+ thor (0.19.4)
43
+ unicode-display_width (1.1.3)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ appraisal
50
+ bundler (~> 1.13)
51
+ rake (~> 10.0)
52
+ rspec-core (~> 3.6.0.beta2)
53
+ rspec-expectations (~> 3.6.0.beta2)
54
+ rspec-preconditions!
55
+ rubocop
56
+ simplecov
57
+
58
+ BUNDLED WITH
59
+ 1.14.6
@@ -0,0 +1,35 @@
1
+ require 'rspec/preconditions/version'
2
+ require 'rspec/core'
3
+
4
+ module RSpec
5
+ module Preconditions
6
+ module ClassMethods
7
+ def preconditions(&block)
8
+ before(:each) do |current_example|
9
+ begin
10
+ # Run the block in the context of the current_example.
11
+ # This doesn't run the current_example.
12
+ RSpec::Core::Hooks::BeforeHook.new(block).run(current_example)
13
+ rescue RSpec::Expectations::ExpectationNotMetError, StandardError
14
+ mark_remaining_examples_pending(current_example)
15
+ raise
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ def mark_remaining_examples_pending(current_example)
22
+ self.class.descendant_filtered_examples.each do |example|
23
+ next if example == current_example
24
+ already_ran = !example.execution_result.status.nil?
25
+ next if already_ran
26
+ RSpec::Core::Pending.mark_pending!(example, true)
27
+ end
28
+ end
29
+ end
30
+
31
+ configure do |config|
32
+ config.extend Preconditions::ClassMethods
33
+ config.include Preconditions
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ module RSpec
2
+ module Preconditions
3
+ VERSION = '0.1.0'.freeze
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rspec/preconditions/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'rspec-preconditions'
8
+ spec.version = RSpec::Preconditions::VERSION
9
+ spec.authors = ['Isaac Betesh']
10
+ spec.email = ['ibetesh@on-site.com']
11
+
12
+ spec.summary = 'Skip duplicate RSpec failures.'
13
+ spec.description = %(
14
+ Sometimes every example in an RSpec example group fails because of a bug
15
+ in the before hook.
16
+ Wouldn't you rather see the error only once, rather than for every single
17
+ example?
18
+ Now you can.
19
+ )
20
+ spec.homepage = 'https://github.com/on-site/rspec-preconditions'
21
+ spec.license = 'MIT'
22
+
23
+ spec.files =
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(test|spec|features)/})
26
+ end
27
+ spec.require_paths = ['lib']
28
+
29
+ spec.add_development_dependency 'bundler', '~> 1.13'
30
+ spec.add_development_dependency 'rake', '~> 10.0'
31
+
32
+ spec.add_dependency 'rspec-core'
33
+ spec.add_dependency 'rspec-expectations'
34
+ end
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-preconditions
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Isaac Betesh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-31 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.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
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-core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-expectations
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: "\n Sometimes every example in an RSpec example group fails because
70
+ of a bug\n in the before hook.\n Wouldn't you rather see the error only
71
+ once, rather than for every single\n example?\n Now you can.\n "
72
+ email:
73
+ - ibetesh@on-site.com
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".rubocop.yml"
81
+ - ".simplecov"
82
+ - ".travis.yml"
83
+ - Appraisals
84
+ - Gemfile
85
+ - LICENSE.txt
86
+ - README.md
87
+ - Rakefile
88
+ - bin/console
89
+ - bin/setup
90
+ - gemfiles/rspec_3.0.gemfile
91
+ - gemfiles/rspec_3.0.gemfile.lock
92
+ - gemfiles/rspec_3.1.gemfile
93
+ - gemfiles/rspec_3.1.gemfile.lock
94
+ - gemfiles/rspec_3.2.gemfile
95
+ - gemfiles/rspec_3.2.gemfile.lock
96
+ - gemfiles/rspec_3.3.gemfile
97
+ - gemfiles/rspec_3.3.gemfile.lock
98
+ - gemfiles/rspec_3.4.gemfile
99
+ - gemfiles/rspec_3.4.gemfile.lock
100
+ - gemfiles/rspec_3.5.gemfile
101
+ - gemfiles/rspec_3.5.gemfile.lock
102
+ - gemfiles/rspec_3.6.gemfile
103
+ - gemfiles/rspec_3.6.gemfile.lock
104
+ - lib/rspec/preconditions.rb
105
+ - lib/rspec/preconditions/version.rb
106
+ - rspec-preconditions.gemspec
107
+ homepage: https://github.com/on-site/rspec-preconditions
108
+ licenses:
109
+ - MIT
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.6.11
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: Skip duplicate RSpec failures.
131
+ test_files: []