turnip 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/turnip/rspec.rb +15 -9
- data/lib/turnip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 051972e6407a8cad966f52027a9d7142e075786b
|
4
|
+
data.tar.gz: 691f8630a4e696a2db00a057a5c9c463fc84cc30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd2618a1d3fe3586064750c923c244df8807681ac99f2b4b5f922d342ade5c96c40ce9c2571c89a5f7736e2d7b22e6f815c1b7f4a9498967011b68bad09848c
|
7
|
+
data.tar.gz: acf9021ab5d8f83e4fee0f9803ccdee839789a4e324c546d71f5fb6deb49479749cb190290bfc692201187ccf3433b18b1d8fa81847c4ef17835d06779f9c4c9
|
data/lib/turnip/rspec.rb
CHANGED
@@ -66,30 +66,36 @@ module Turnip
|
|
66
66
|
def run(feature_file)
|
67
67
|
Turnip::Builder.build(feature_file).features.each do |feature|
|
68
68
|
instance_eval <<-EOS, feature_file, feature.line
|
69
|
-
|
70
|
-
run_feature(
|
69
|
+
context = ::RSpec.describe feature.name, feature.metadata_hash
|
70
|
+
run_feature(context, feature, feature_file)
|
71
71
|
EOS
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
75
|
private
|
76
76
|
|
77
|
-
def run_feature(
|
78
|
-
|
79
|
-
|
77
|
+
def run_feature(context, feature, filename)
|
78
|
+
background_steps = feature.backgrounds.map(&:steps).flatten
|
79
|
+
|
80
|
+
context.before do
|
81
|
+
background_steps.each do |step|
|
80
82
|
run_step(filename, step)
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
84
86
|
feature.scenarios.each do |scenario|
|
85
|
-
|
86
|
-
|
87
|
+
step_names = (background_steps + scenario.steps).map(&:to_s)
|
88
|
+
description = step_names.join(' -> ')
|
89
|
+
|
90
|
+
context.describe scenario.name, scenario.metadata_hash do
|
91
|
+
instance_eval <<-EOS, filename, scenario.line
|
92
|
+
it description do
|
87
93
|
scenario.steps.each do |step|
|
88
94
|
run_step(filename, step)
|
89
95
|
end
|
90
96
|
end
|
91
|
-
|
92
|
-
|
97
|
+
EOS
|
98
|
+
end
|
93
99
|
end
|
94
100
|
end
|
95
101
|
end
|
data/lib/turnip/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|