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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e13764190ae64991bef56ee17f874dd70b34a43c
4
- data.tar.gz: 0194234d5c5560fcae6ed4ec1f98c4127e273473
3
+ metadata.gz: 051972e6407a8cad966f52027a9d7142e075786b
4
+ data.tar.gz: 691f8630a4e696a2db00a057a5c9c463fc84cc30
5
5
  SHA512:
6
- metadata.gz: 17511f911bcba948491f6cb3f8db9b64492c41c85d497f9f4dc442ba52895a86e34b581e01dfec77a55b2104ba34d8b42ada890af8a3a44066e7083daf10495c
7
- data.tar.gz: 087b15c4ceddaab438898380f5c20f8cec905a253858275c697d3c634dc291c9adb9a8a85b66f1131b9e4859043894e0413bedc6a68eb5c7390ebf1f0fc2c873
6
+ metadata.gz: 7dd2618a1d3fe3586064750c923c244df8807681ac99f2b4b5f922d342ade5c96c40ce9c2571c89a5f7736e2d7b22e6f815c1b7f4a9498967011b68bad09848c
7
+ data.tar.gz: acf9021ab5d8f83e4fee0f9803ccdee839789a4e324c546d71f5fb6deb49479749cb190290bfc692201187ccf3433b18b1d8fa81847c4ef17835d06779f9c4c9
@@ -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
- describe = ::RSpec.describe feature.name, feature.metadata_hash
70
- run_feature(describe, feature, feature_file)
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(describe, feature, filename)
78
- describe.before do
79
- feature.backgrounds.map(&:steps).flatten.each do |step|
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
- instance_eval <<-EOS, filename, scenario.line
86
- describe.describe scenario.name, scenario.metadata_hash do it(scenario.steps.map(&:to_s).join(' -> ')) do
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
- end
92
- EOS
97
+ EOS
98
+ end
93
99
  end
94
100
  end
95
101
  end
@@ -1,3 +1,3 @@
1
1
  module Turnip
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
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.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-19 00:00:00.000000000 Z
11
+ date: 2015-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec