rspec-steps 2.1.0 → 2.1.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 +4 -4
- data/lib/rspec-steps/step-list.rb +4 -4
- data/lib/rspec-steps/step.rb +3 -3
- data/spec/example_group_spec.rb +13 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f112d19a719d7956c031647cb0a1cfa8651436e
|
4
|
+
data.tar.gz: 149d4f6150228619d2d78ace9820f4f2b4e4e43a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbd23ee881a5bbc396dc4a6ffc1da0b4af5475495b4789cbcbaefeb681d36d8e0f8f1662734d16c0efc71dfa78a4857f98c1ae7eaa01e3721cac06e4baecc613
|
7
|
+
data.tar.gz: 252fe86e010b4d0231a8cb597c10cbbe10ac4a6dcb81a1cc83d2fc5d03df7f16cfb6571983eabc9eab5b958497fd77d119766b54b9bfdef94ad97395a08d3fcf
|
@@ -52,7 +52,7 @@ module RSpec::Steps
|
|
52
52
|
@results[step]
|
53
53
|
end
|
54
54
|
|
55
|
-
def run_only_once(context_example)
|
55
|
+
def run_only_once(context_example, running_example)
|
56
56
|
return unless @results.nil?
|
57
57
|
failed_step = nil
|
58
58
|
@let_bangs.each do |let_name|
|
@@ -63,7 +63,7 @@ module RSpec::Steps
|
|
63
63
|
[
|
64
64
|
step,
|
65
65
|
if failed_step.nil?
|
66
|
-
result = capture_result(step, context_example)
|
66
|
+
result = capture_result(step, context_example, running_example)
|
67
67
|
if result.failed?
|
68
68
|
failed_step = result
|
69
69
|
end
|
@@ -75,8 +75,8 @@ module RSpec::Steps
|
|
75
75
|
end ]
|
76
76
|
end
|
77
77
|
|
78
|
-
def capture_result(step, context_example)
|
79
|
-
StepResult.new(step, step.run_inside(context_example), nil, nil)
|
78
|
+
def capture_result(step, context_example, running_example)
|
79
|
+
StepResult.new(step, step.run_inside(context_example, running_example), nil, nil)
|
80
80
|
rescue BasicObject => ex
|
81
81
|
StepResult.new(step, nil, ex, nil)
|
82
82
|
end
|
data/lib/rspec-steps/step.rb
CHANGED
@@ -9,15 +9,15 @@ module RSpec::Steps
|
|
9
9
|
def define_on(step_list, example_group)
|
10
10
|
step = self
|
11
11
|
example_group.it(*args, metadata) do |example|
|
12
|
-
step_list.run_only_once(self)
|
12
|
+
step_list.run_only_once(self, example)
|
13
13
|
result = step_list.result_for(step)
|
14
14
|
pending if result.is_after_failed_step?
|
15
15
|
expect(result).to have_executed_successfully
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def run_inside(example)
|
20
|
-
example.
|
19
|
+
def run_inside(example, ex_obj)
|
20
|
+
example.instance_exec(ex_obj, &action)
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
data/spec/example_group_spec.rb
CHANGED
@@ -83,6 +83,19 @@ describe RSpec::Core::ExampleGroup do
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
+
it "should be able to access an example in blocks" do
|
87
|
+
group = nil
|
88
|
+
metadata = nil
|
89
|
+
sandboxed do
|
90
|
+
group = RSpec.steps "Test Steps" do
|
91
|
+
it("sets @a"){|example| metadata = example.metadata }
|
92
|
+
end
|
93
|
+
group.run
|
94
|
+
end
|
95
|
+
|
96
|
+
expect(metadata.respond_to?(:[])).to be_truthy
|
97
|
+
end
|
98
|
+
|
86
99
|
it "should run each_step hooks" do
|
87
100
|
group = nil
|
88
101
|
afters = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Judson Lester
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: corundum
|
@@ -341,7 +341,7 @@ rdoc_options:
|
|
341
341
|
- --main
|
342
342
|
- doc/README
|
343
343
|
- --title
|
344
|
-
- rspec-steps-2.1.
|
344
|
+
- rspec-steps-2.1.1 RDoc
|
345
345
|
require_paths:
|
346
346
|
- lib/
|
347
347
|
required_ruby_version: !ruby/object:Gem::Requirement
|