rspec-steps 1.0.6 → 1.0.7
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/stepwise.rb +16 -3
- 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: b804a788e4bfa076e61bc2a419b51c99e54b6c76
|
4
|
+
data.tar.gz: 6ac4eb145511c37195bf5f5f6bbe0d8267206ef5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5cda2dabaeaad923da667d1df109a30e7c8db286497a77106985ed8a1a9b96ecd4bae74fe9a8ea646e11d00ff834a46ecd20d6214494ed40c1545e71e0415a9
|
7
|
+
data.tar.gz: 58ba1df734ad86c78db857d4987676d93c76d53c83d9faf33c3b04ab4a08e7b479713b996a2eaaf4ba4e97b08cb8cf383368d4f7e7debc47463c5683350e203b
|
data/lib/rspec-steps/stepwise.rb
CHANGED
@@ -84,6 +84,13 @@ module RSpecStepwise
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
def self.warnings
|
88
|
+
@warnings ||= Hash.new do |h,warning|
|
89
|
+
puts warning #should be warn, but RSpec complains
|
90
|
+
h[warning] = true
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
87
94
|
module ClassMethods
|
88
95
|
#This is hacky and needs a more general solution
|
89
96
|
#Something like cloning the current conf and having RSpec::Stepwise::config ?
|
@@ -126,6 +133,12 @@ module RSpecStepwise
|
|
126
133
|
end
|
127
134
|
end
|
128
135
|
|
136
|
+
def warn_about_promotion(scope_name)
|
137
|
+
RSpecStepwise.warnings[
|
138
|
+
"#{scope_name} :each blocks declared for steps are always treated as " +
|
139
|
+
":all scope (it's possible you want #{scope_name} :step)"]
|
140
|
+
end
|
141
|
+
|
129
142
|
def before(*args, &block)
|
130
143
|
if args.first == :step
|
131
144
|
args.shift
|
@@ -133,7 +146,7 @@ module RSpecStepwise
|
|
133
146
|
return ((hooks[:before][:step] ||= []) << build_before_hook(options, &block))
|
134
147
|
end
|
135
148
|
if args.first == :each
|
136
|
-
|
149
|
+
warn_about_promotion("before")
|
137
150
|
end
|
138
151
|
super
|
139
152
|
end
|
@@ -146,14 +159,14 @@ module RSpecStepwise
|
|
146
159
|
return (hooks[:after][:step].unshift build_after_hook(options, &block))
|
147
160
|
end
|
148
161
|
if args.first == :each
|
149
|
-
|
162
|
+
warn_about_promotion("after")
|
150
163
|
end
|
151
164
|
super
|
152
165
|
end
|
153
166
|
|
154
167
|
def around(*args, &block)
|
155
168
|
if args.first == :each
|
156
|
-
|
169
|
+
warn_about_promotion("around")
|
157
170
|
end
|
158
171
|
super
|
159
172
|
end
|
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: 1.0.
|
4
|
+
version: 1.0.7
|
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: 2014-12-
|
12
|
+
date: 2014-12-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: corundum
|
@@ -329,7 +329,7 @@ rdoc_options:
|
|
329
329
|
- --main
|
330
330
|
- doc/README
|
331
331
|
- --title
|
332
|
-
- rspec-steps-1.0.
|
332
|
+
- rspec-steps-1.0.7 RDoc
|
333
333
|
require_paths:
|
334
334
|
- lib/
|
335
335
|
required_ruby_version: !ruby/object:Gem::Requirement
|