rrrspec-rspec 1.0.0
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 +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +43 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/rrrspec/rspec/rspec_runner.rb +95 -0
- data/lib/rrrspec/rspec/rspec_runner_factory.rb +14 -0
- data/lib/rrrspec/rspec/version.rb +5 -0
- data/lib/rrrspec/rspec.rb +3 -0
- data/rrrspec-rspec.gemspec +25 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 13ba4bdf8601c26ef7327968f8b514ba045b1398
|
4
|
+
data.tar.gz: edf11d1d1ad69344d615cc490fda3264434bc750
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3117568d478b05ed98621180e9b4ccb66f74317625da95956a65fdfc6849e5a310c7c18df3819795088ebcbb2c5f0088f95b6a6f1f8ca7e6babe1e85deaa26b0
|
7
|
+
data.tar.gz: 9c3ce9c3d3138881385e79c3b003b2d855d897962eb175fb2c4024caafdb804c114ebe4477383affb637b0a5263e012299415764ac8fb8228adc02790409e035
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rrrspec-rspec (1.0.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.1)
|
10
|
+
diff-lcs (1.3)
|
11
|
+
method_source (0.8.2)
|
12
|
+
pry (0.10.4)
|
13
|
+
coderay (~> 1.1.0)
|
14
|
+
method_source (~> 0.8.1)
|
15
|
+
slop (~> 3.4)
|
16
|
+
rake (10.5.0)
|
17
|
+
rspec (3.5.0)
|
18
|
+
rspec-core (~> 3.5.0)
|
19
|
+
rspec-expectations (~> 3.5.0)
|
20
|
+
rspec-mocks (~> 3.5.0)
|
21
|
+
rspec-core (3.5.4)
|
22
|
+
rspec-support (~> 3.5.0)
|
23
|
+
rspec-expectations (3.5.0)
|
24
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
+
rspec-support (~> 3.5.0)
|
26
|
+
rspec-mocks (3.5.0)
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
+
rspec-support (~> 3.5.0)
|
29
|
+
rspec-support (3.5.0)
|
30
|
+
slop (3.6.0)
|
31
|
+
|
32
|
+
PLATFORMS
|
33
|
+
ruby
|
34
|
+
|
35
|
+
DEPENDENCIES
|
36
|
+
bundler (~> 1.11)
|
37
|
+
pry (~> 0.10.4)
|
38
|
+
rake (~> 10.0)
|
39
|
+
rrrspec-rspec!
|
40
|
+
rspec (~> 3.0)
|
41
|
+
|
42
|
+
BUNDLED WITH
|
43
|
+
1.11.2
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Rrrspec::Rspec
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rrrspec/rspec`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'rrrspec-rspec'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install rrrspec-rspec
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
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.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rrrspec-cucumber2.
|
36
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "rrrspec/cucumber"
|
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
|
data/bin/setup
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'pry'
|
2
|
+
|
3
|
+
module RRRSpec
|
4
|
+
module RSpec
|
5
|
+
class RSpecRunner
|
6
|
+
|
7
|
+
def setup(file_path)
|
8
|
+
@file_path = file_path
|
9
|
+
status = true
|
10
|
+
|
11
|
+
[status, '', '']
|
12
|
+
end
|
13
|
+
|
14
|
+
def run(*formatters)
|
15
|
+
status = false
|
16
|
+
result_err = ''
|
17
|
+
|
18
|
+
begin
|
19
|
+
result_out = `SLAVE_NUMBER=#{ENV['SLAVE_NUMBER']} bundle exec rspec #{@file_path}`
|
20
|
+
|
21
|
+
formatters.each do |formatter_class|
|
22
|
+
formatter = formatter_class.new nil
|
23
|
+
process_result(formatter, result_out)
|
24
|
+
end
|
25
|
+
|
26
|
+
status = true
|
27
|
+
rescue Exception => e
|
28
|
+
result_err = e.message
|
29
|
+
end
|
30
|
+
|
31
|
+
[status, result_out, result_err]
|
32
|
+
end
|
33
|
+
|
34
|
+
def reset
|
35
|
+
@file_path = ''
|
36
|
+
end
|
37
|
+
|
38
|
+
def process_result(formatter, result)
|
39
|
+
results_line = result.lines[get_step_result_line(result)]
|
40
|
+
|
41
|
+
failing_steps_count = failing_steps_count(results_line)
|
42
|
+
pending_steps_count = pending_steps_count(results_line)
|
43
|
+
total_steps_count = total_steps_count(results_line)
|
44
|
+
|
45
|
+
(failing_steps_count + pending_steps_count).times do
|
46
|
+
formatter.example_failed nil
|
47
|
+
end
|
48
|
+
|
49
|
+
(total_steps_count - failing_steps_count - pending_steps_count).times do
|
50
|
+
formatter.example_passed nil
|
51
|
+
end
|
52
|
+
|
53
|
+
pending_steps_count.times do
|
54
|
+
formatter.example_pending nil
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def get_step_result_line(rspec_output)
|
59
|
+
rspec_output.lines.each_with_index do |line, line_number|
|
60
|
+
if /(\d*) examples?, (\d*) failures?/ =~ line
|
61
|
+
return line_number
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
-1
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def failing_steps_count(results_line)
|
71
|
+
if results_line.match(/(\d+) failure/)
|
72
|
+
results_line.match(/(\d+) failure/)[1].to_i
|
73
|
+
else
|
74
|
+
0
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def pending_steps_count(results_line)
|
79
|
+
if results_line.match(/(\d+) pending/)
|
80
|
+
results_line.match(/(\d+) pending/)[1].to_i
|
81
|
+
else
|
82
|
+
0
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def total_steps_count(results_line)
|
87
|
+
if results_line.match(/(\d+) example/)
|
88
|
+
results_line.match(/(\d+) example/)[1].to_i
|
89
|
+
else
|
90
|
+
0
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rrrspec/rspec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'rrrspec-rspec'
|
8
|
+
spec.version = RRRSpec::RSpec::VERSION
|
9
|
+
spec.authors = ['João Luís']
|
10
|
+
spec.email = ['jrluis@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'This gem adds rspec support to rrrspec'
|
13
|
+
spec.homepage = 'https://github.com/Seedrs/rrrspec-rspec'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
24
|
+
spec.add_development_dependency 'pry', '~> 0.10.4'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rrrspec-rspec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- João Luís
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-23 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.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
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: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.10.4
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.10.4
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- jrluis@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- Gemfile
|
77
|
+
- Gemfile.lock
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- bin/console
|
81
|
+
- bin/setup
|
82
|
+
- lib/rrrspec/rspec.rb
|
83
|
+
- lib/rrrspec/rspec/rspec_runner.rb
|
84
|
+
- lib/rrrspec/rspec/rspec_runner_factory.rb
|
85
|
+
- lib/rrrspec/rspec/version.rb
|
86
|
+
- rrrspec-rspec.gemspec
|
87
|
+
homepage: https://github.com/Seedrs/rrrspec-rspec
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.5.2
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: This gem adds rspec support to rrrspec
|
111
|
+
test_files: []
|