rspec-steps 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rspec-steps/stepwise.rb +16 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b601f7436b3a19b5be52cdb5ebec988db0e60039
4
- data.tar.gz: 6600892ccbc34c73b285a821cbbf28d75b1a6db7
3
+ metadata.gz: b804a788e4bfa076e61bc2a419b51c99e54b6c76
4
+ data.tar.gz: 6ac4eb145511c37195bf5f5f6bbe0d8267206ef5
5
5
  SHA512:
6
- metadata.gz: ec3e5b77e2c69ebfbf1021701ef51bbf9c237d0e5bd234022cd86eec770055be7c36409b551a124e56bb438f28144b5fab48453e8f964c6788f9c4e76cffaf6c
7
- data.tar.gz: 12f9a3de5887c5f4f4fcf50ba238568be8e5c67f41d5ec38a1c17fc6614ed871e9d81613924a7dbeffd941c80835b9eb5a772b9d9a6c7c1f7ee2eac0c92c26d1
6
+ metadata.gz: b5cda2dabaeaad923da667d1df109a30e7c8db286497a77106985ed8a1a9b96ecd4bae74fe9a8ea646e11d00ff834a46ecd20d6214494ed40c1545e71e0415a9
7
+ data.tar.gz: 58ba1df734ad86c78db857d4987676d93c76d53c83d9faf33c3b04ab4a08e7b479713b996a2eaaf4ba4e97b08cb8cf383368d4f7e7debc47463c5683350e203b
@@ -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
- puts "before blocks declared for steps are always treated as :all scope"
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
- puts "after blocks declared for steps are always treated as :all scope"
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
- puts "around :each blocks declared for steps are treated as :all scope"
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.6
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-06 00:00:00.000000000 Z
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.6 RDoc
332
+ - rspec-steps-1.0.7 RDoc
333
333
  require_paths:
334
334
  - lib/
335
335
  required_ruby_version: !ruby/object:Gem::Requirement