rspec-bisect 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1fdcaa0d3095d1ab62552d1f3eec1aa095c9d65f
4
+ data.tar.gz: a5a5f471b893b05ec9f62833972abd7b238fb13d
5
+ SHA512:
6
+ metadata.gz: 8936e9b385e22c47f060b1777706cf7012cd8ba980633e9c6bcc093faeabf05c3a85feb7ba2202a6cd134276ccd85fb7ff493ad4cde66287b704b56a76bf3593
7
+ data.tar.gz: d94969a155f4d9922820f2ebbf1b223423706585ceb9019c2f4f53d1dd8e7e7a0b93751bc02c89dc54c75fa25502506d4b7f5c44e290d0937cfa1138ab9c209e
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+
16
+ # Editor files
17
+ .idea
18
+
19
+ # Compiled gems
20
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-bisect.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Shelby Doolittle
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Rspec::Bisect
2
+
3
+ Detect order dependencies in rspec test suites and print a minimal list of tests required to reproduce it.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'rspec-bisect'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install rspec-bisect
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/rspec-bisect/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/rspec-bisect ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'json'
4
+
5
+ result = `rspec --format json`
6
+ parsed = JSON.parse result
7
+
8
+ failure_count = parsed["summary"]["failure_count"]
9
+ if failure_count > 0
10
+ puts "#{failure_count} failing test#{failure_count > 1 ? 's' : ''}."
11
+ else
12
+ puts "No failing tests."
13
+ end
14
+
15
+ puts "No order dependencies."
@@ -0,0 +1,32 @@
1
+ Feature: no order dependencies
2
+
3
+ Scenario: One failing test
4
+ Given a file named "spec/failing_spec.rb" with:
5
+ """ruby
6
+ RSpec.describe 'failing test' do
7
+ it 'fails' do
8
+ expect(1).to eq 2
9
+ end
10
+ end
11
+ """
12
+ When I run `rspec-bisect`
13
+ Then the output should contain "1 failing test."
14
+ And the output should not contain "No failing tests."
15
+ And the output should contain "No order dependencies."
16
+
17
+ Scenario: Two failing tests
18
+ Given a file named "spec/failing_spec.rb" with:
19
+ """ruby
20
+ RSpec.describe 'failing test' do
21
+ it 'fails' do
22
+ expect(1).to eq 2
23
+ end
24
+ it 'fails also' do
25
+ expect(2).to eq 3
26
+ end
27
+ end
28
+ """
29
+ When I run `rspec-bisect`
30
+ Then the output should contain "2 failing tests."
31
+ And the output should not contain "No failing tests."
32
+ And the output should contain "No order dependencies."
@@ -0,0 +1,28 @@
1
+ Feature: no failures with no tests
2
+
3
+ Scenario: no test files
4
+ When I run `rspec-bisect`
5
+ Then the output should contain "No failing tests."
6
+ And the output should contain "No order dependencies."
7
+
8
+ Scenario: no tests defined
9
+ Given a file named "spec/empty_spec.rb" with:
10
+ """ruby
11
+ RSpec.describe 'no tests' do
12
+ end
13
+ """
14
+ When I run `rspec-bisect`
15
+ Then the output should contain "No failing tests."
16
+ And the output should contain "No order dependencies."
17
+
18
+ Scenario: no failing tests
19
+ Given a file named "spec/empty_spec.rb" with:
20
+ """ruby
21
+ RSpec.describe 'no tests' do
22
+ it 'passes' do
23
+ end
24
+ end
25
+ """
26
+ When I run `rspec-bisect`
27
+ Then the output should contain "No failing tests."
28
+ And the output should contain "No order dependencies."
File without changes
@@ -0,0 +1,7 @@
1
+ $: << File.expand_path("../../lib", File.dirname(__FILE__))
2
+ require 'rspec/bisect'
3
+ require 'aruba/cucumber'
4
+
5
+ Before do
6
+ @aruba_timeout_seconds = 5
7
+ end
@@ -0,0 +1,7 @@
1
+ require "rspec/bisect/version"
2
+
3
+ module Rspec
4
+ module Bisect
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Rspec
2
+ module Bisect
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rspec/bisect/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rspec-bisect"
8
+ spec.version = Rspec::Bisect::VERSION
9
+ spec.authors = ["Shelby Doolittle"]
10
+ spec.email = ["shelby@shelbyd.com"]
11
+ spec.summary = %q{Detect order dependencies in rspec test suites.}
12
+ spec.description = %q{Detect order dependencies in rspec test suites. Also print the minimal set of tests to reproduce the failure(s).}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "cucumber"
24
+ spec.add_development_dependency "aruba"
25
+ spec.add_development_dependency "rspec", "~> 3"
26
+ end
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-bisect
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Shelby Doolittle
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-30 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.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
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: cucumber
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
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: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3'
83
+ description: Detect order dependencies in rspec test suites. Also print the minimal
84
+ set of tests to reproduce the failure(s).
85
+ email:
86
+ - shelby@shelbyd.com
87
+ executables:
88
+ - rspec-bisect
89
+ extensions: []
90
+ extra_rdoc_files: []
91
+ files:
92
+ - ".gitignore"
93
+ - Gemfile
94
+ - LICENSE.txt
95
+ - README.md
96
+ - Rakefile
97
+ - bin/rspec-bisect
98
+ - features/failing_tests/no_order_dependencies.feature
99
+ - features/no_tests.feature
100
+ - features/step_definitions/rspec-bisect_steps.rb
101
+ - features/support/env.rb
102
+ - lib/rspec/bisect.rb
103
+ - lib/rspec/bisect/version.rb
104
+ - rspec-bisect.gemspec
105
+ homepage: ''
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.4.2
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: Detect order dependencies in rspec test suites.
129
+ test_files:
130
+ - features/failing_tests/no_order_dependencies.feature
131
+ - features/no_tests.feature
132
+ - features/step_definitions/rspec-bisect_steps.rb
133
+ - features/support/env.rb
134
+ has_rdoc: