rutabaga 2.1.6 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +12 -4
- data/CHANGELOG.md +6 -0
- data/{Gemfile.turnip2 → Gemfile.turnip3} +1 -1
- data/README.md +2 -2
- data/examples/test_spec.rb +1 -3
- data/lib/rutabaga.rb +0 -1
- data/lib/rutabaga/util.rb +8 -9
- data/lib/rutabaga/version.rb +1 -1
- data/rutabaga.gemspec +1 -1
- data/spec/feature_spec.rb +1 -5
- metadata +8 -11
- data/lib/rutabaga/feature.rb +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 396a9f18753e8f782961dc51ab7921804cc5f7aa860367de27c374a8b1f5cc50
|
4
|
+
data.tar.gz: cc7123622b454d61a9fe058ded68011153f4101ad6d40382e2ab1c254677bcd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e0d4ba85c3125c08b13a62a2ef5baaa3ce89f1f3a10eaa19493979d0b7a897af1f39c29b140e9a24c3d913b190a0456047f02a73c71487a6b6b00ea5b30a47d
|
7
|
+
data.tar.gz: 26b1d0ba08c4ae8a75f81b7f19fa332b228f834557a7c6175d6970ceb97de55856df29fa48fdeebbff2dd67b16d388a9973e61ac0e5b21c2feeb09300b52895f
|
data/.travis.yml
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
-
|
3
|
+
- 2.4
|
4
|
+
- 2.5
|
5
|
+
- 2.6
|
6
|
+
- jruby
|
6
7
|
|
7
8
|
gemfile:
|
8
9
|
- Gemfile
|
9
|
-
- ./Gemfile.
|
10
|
+
- ./Gemfile.turnip3
|
11
|
+
|
12
|
+
matrix:
|
13
|
+
allow_failures:
|
14
|
+
- rvm: 2.6 # Google protobuf, requirement for turnip 4 not compatible yet
|
15
|
+
gemfile: Gemfile
|
16
|
+
- rvm: jruby # Google protobuf, requirement for turnip 4 not compatible yet
|
17
|
+
gemfile: Gemfile
|
10
18
|
|
11
19
|
script: bundle exec rspec spec
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -199,9 +199,9 @@ Put the following (example in a `Gemfile_for_xxx`) to test other versions of gem
|
|
199
199
|
# Use global Gemfile and customize
|
200
200
|
eval(IO.read('Gemfile'), binding)
|
201
201
|
|
202
|
-
gem 'turnip', '
|
202
|
+
gem 'turnip', '3.1.0'
|
203
203
|
```
|
204
204
|
|
205
205
|
## Copyright
|
206
206
|
|
207
|
-
Copyright © 2012-
|
207
|
+
Copyright © 2012-2019 Simply Business. See LICENSE for details.
|
data/examples/test_spec.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe "should find the feature file using the root (and monkey patching the result)" do
|
4
|
-
|
5
|
-
feature
|
6
|
-
end
|
4
|
+
feature "examples/test2.feature"
|
7
5
|
|
8
6
|
step "that :first + :second is calculated" do |first, second|
|
9
7
|
@first = first
|
data/lib/rutabaga.rb
CHANGED
data/lib/rutabaga/util.rb
CHANGED
@@ -3,11 +3,15 @@
|
|
3
3
|
# Monkey patch for Turnip to not have to copy loads of code
|
4
4
|
module Turnip::RSpec
|
5
5
|
def self.rutabaga_run(feature_file, example_group_class)
|
6
|
-
features = Rutabaga::Util.
|
6
|
+
features = Rutabaga::Util.build_scenario_groups(feature_file)
|
7
7
|
features.each do |feature|
|
8
8
|
instance_eval <<-EOS, feature_file, feature.line
|
9
9
|
describe = example_group_class.describe feature.name, feature.metadata_hash.reject { |key, _| key == :type }
|
10
|
-
|
10
|
+
if Turnip::VERSION[0].to_i >= 4
|
11
|
+
run_scenario_group(describe, feature, feature_file)
|
12
|
+
else # run against turnip 3
|
13
|
+
run_feature(describe, feature, feature_file)
|
14
|
+
end
|
11
15
|
EOS
|
12
16
|
end
|
13
17
|
end
|
@@ -44,12 +48,8 @@ module Rutabaga
|
|
44
48
|
raise unless e.message.include?(filename)
|
45
49
|
end
|
46
50
|
|
47
|
-
def
|
48
|
-
|
49
|
-
[Turnip::Builder.build(feature_file)]
|
50
|
-
else
|
51
|
-
Turnip::Builder.build(feature_file).features
|
52
|
-
end
|
51
|
+
def build_scenario_groups(feature_file)
|
52
|
+
[Turnip::Builder.build(feature_file)]
|
53
53
|
end
|
54
54
|
|
55
55
|
private
|
@@ -71,7 +71,6 @@ module Rutabaga
|
|
71
71
|
end
|
72
72
|
|
73
73
|
::RSpec.configure do |c|
|
74
|
-
c.include Rutabaga::Feature
|
75
74
|
# Blow away turnip's pattern, and focus just on features directory
|
76
75
|
if defined?(Rutabaga::NO_TURNIP)
|
77
76
|
c.pattern.gsub!(",**/*.feature", "")
|
data/lib/rutabaga/version.rb
CHANGED
data/rutabaga.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = Rutabaga::VERSION
|
17
17
|
gem.license = 'MIT'
|
18
18
|
|
19
|
-
gem.add_runtime_dependency 'turnip', ['>=
|
19
|
+
gem.add_runtime_dependency 'turnip', ['>= 3.1.0', '< 5.0']
|
20
20
|
gem.add_runtime_dependency 'rspec', ['~> 3.0']
|
21
21
|
|
22
22
|
gem.add_development_dependency 'capybara'
|
data/spec/feature_spec.rb
CHANGED
@@ -30,7 +30,7 @@ describe 'integration', :type => :integration do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "prints out failures and successes" do
|
33
|
-
expect(@result).to include('
|
33
|
+
expect(@result).to include('18 examples, 4 failures')
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should find features relative to the root" do
|
@@ -49,10 +49,6 @@ describe 'integration', :type => :integration do
|
|
49
49
|
it "should provide failure messages that allow a specific scenario to be run" do
|
50
50
|
expect(@result).to include("rspec ./examples/test_feature_example_group_spec.rb[1:1:1:4:1]")
|
51
51
|
end
|
52
|
-
|
53
|
-
it "should have a feature deprecation warning" do
|
54
|
-
expect(@result).to include("Calling `feature` from an `it` block is deprecated.")
|
55
|
-
end
|
56
52
|
end
|
57
53
|
|
58
54
|
describe 'compatibility' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutabaga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Oberhuber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: turnip
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.1.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 3.1.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '5.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,7 +83,7 @@ files:
|
|
83
83
|
- ".travis.yml"
|
84
84
|
- CHANGELOG.md
|
85
85
|
- Gemfile
|
86
|
-
- Gemfile.
|
86
|
+
- Gemfile.turnip3
|
87
87
|
- LICENSE
|
88
88
|
- README.md
|
89
89
|
- Rakefile
|
@@ -100,7 +100,6 @@ files:
|
|
100
100
|
- lib/rspec/core/example_group_patch.rb
|
101
101
|
- lib/rutabaga.rb
|
102
102
|
- lib/rutabaga/example_group/feature.rb
|
103
|
-
- lib/rutabaga/feature.rb
|
104
103
|
- lib/rutabaga/no_turnip.rb
|
105
104
|
- lib/rutabaga/turnip.rb
|
106
105
|
- lib/rutabaga/util.rb
|
@@ -133,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
132
|
- !ruby/object:Gem::Version
|
134
133
|
version: '0'
|
135
134
|
requirements: []
|
136
|
-
|
137
|
-
rubygems_version: 2.6.8
|
135
|
+
rubygems_version: 3.0.2
|
138
136
|
signing_key:
|
139
137
|
specification_version: 4
|
140
138
|
summary: Calling Turnip feature files from RSpec, which allows encapsulating a feature
|
@@ -147,4 +145,3 @@ test_files:
|
|
147
145
|
- spec/rspec_formatter/formatter.rb
|
148
146
|
- spec/rutabaga/util_spec.rb
|
149
147
|
- spec/spec_helper.rb
|
150
|
-
has_rdoc:
|
data/lib/rutabaga/feature.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'turnip/rspec'
|
2
|
-
require 'rspec'
|
3
|
-
|
4
|
-
module Rutabaga
|
5
|
-
module Feature
|
6
|
-
def feature(feature_file = nil)
|
7
|
-
RSpec.deprecate(
|
8
|
-
"Calling `feature` from an `it` block",
|
9
|
-
:message => "Calling `feature` from an `it` block " \
|
10
|
-
"is deprecated.\nYou should now put your steps inside " \
|
11
|
-
"a `feature` block.\n\n" \
|
12
|
-
"```\n" \
|
13
|
-
"feature \"optional feature file location\" do\n" \
|
14
|
-
" step \"a step\" do\n" \
|
15
|
-
" ...\n" \
|
16
|
-
" end\n" \
|
17
|
-
"end\n" \
|
18
|
-
"```"
|
19
|
-
)
|
20
|
-
|
21
|
-
feature_file = Util.find_feature(feature_file || RSpec.current_example.description)
|
22
|
-
example_group_class = self.class
|
23
|
-
|
24
|
-
# Hack turnip into the rspec only when needed
|
25
|
-
example_group_class.send(:include, Turnip::RSpec::Execute)
|
26
|
-
example_group_class.send(:include, Turnip::Steps)
|
27
|
-
|
28
|
-
run(feature_file, example_group_class)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Adapted from jnicklas/turnip v2.0.0
|
32
|
-
def run(feature_file, example_group_class)
|
33
|
-
features = Util.build_features(feature_file)
|
34
|
-
features.each do |feature|
|
35
|
-
describe = example_group_class.describe feature.name, feature.metadata_hash
|
36
|
-
run_feature(describe, feature, feature_file, example_group_class)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def run_feature(describe, feature, filename, example_group_class)
|
41
|
-
example_group_class.before do
|
42
|
-
# This is kind of a hack, but it will make RSpec throw way nicer exceptions
|
43
|
-
RSpec.current_example.metadata[:file_path] = filename
|
44
|
-
|
45
|
-
feature.backgrounds.map(&:steps).flatten.each do |step|
|
46
|
-
run_step(filename, step)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
feature.scenarios.each do |scenario|
|
51
|
-
example_group_class.describe scenario.name, scenario.metadata_hash do
|
52
|
-
it(scenario.steps.map(&:to_s).join(' -> ')) do
|
53
|
-
scenario.steps.each do |step|
|
54
|
-
run_step(filename, step)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|