macros4cuke 0.2.16 → 0.2.17

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.2.17 / 2013-05-05
2
+ * [CHANGE] File `engine_spec.rb`: Added more RSpec examples. SimpleCov code coverage raised to more than 96%.
3
+ * [CHANGE] Added section in README.md
4
+
5
+
1
6
  ## 0.2.16 / 2013-05-04
2
7
  * [FEATURE] Added dependency to SimpleCov. It is used to measure test code coverage (the combination of Cucumber and RSpec result in 95.9% code coverage).
3
8
  * [CHANGE] File `macro-step-support_spec.rb`: Added one RSpec example
data/README.md CHANGED
@@ -245,6 +245,22 @@ Here are few observations worth noticing:
245
245
  the value "Main Street, 22".
246
246
  - Data rows don't have to follow strictly the order of the arguments in the sub-step sequence.
247
247
 
248
+ ## With great power comes great responsibility. ##
249
+ _Stan Lee_
250
+
251
+ Our experience is that macro-steps change deeply the way one designs and writes feature files.
252
+ Macro-steps are most useful in UI-testing (e.g. with tools like Capybara) because they help to close
253
+ the gap between the user's intent and the low-level user interface actions.
254
+ In addition __Macros4Cuke__ allows advanced users to craft their own steps without having to program step definitions.
255
+ This last argument becomes important in the context of user acceptance testing, a domain where the assumption that
256
+ every tester is also Rubyist is -alas!- far from the truth.
257
+
258
+
259
+ Macros with Cucumber is highly debated topic, so it is always wise to know what other people say about it:
260
+ [Support for Macros] (https://github.com/cucumber/gherkin/issues/178)
261
+ [Substeps - macro request for the nth time] (http://grokbase.com/t/gg/cukes/133ey063b8/cucumber-substeps-macro-request-for-the-nth-time)
262
+
263
+
248
264
  Copyright
249
265
  ---------
250
266
  Copyright (c) 2013, Dimitri Geshef. Macros4Cuke is released under the MIT License see [LICENSE.txt](https://github.com/famished-tiger/Macros4Cuke/blob/master/LICENSE.txt) for details.
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Macros4Cuke # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.2.16'
6
+ Version = '0.2.17'
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = "Macros for Cucumber"
@@ -134,6 +134,18 @@ SNIPPET
134
134
  error_message = "Missing closing chevron '>'."
135
135
  lambda { Engine::parse(sample_text) }.should raise_error(StandardError, error_message)
136
136
  end
137
+
138
+ it "should complain if a text misses an opening chevron" do
139
+ sample_text = 'begin <some_tag> > end'
140
+ error_message = "Missing opening chevron '<'."
141
+ lambda { Engine::parse(sample_text) }.should raise_error(StandardError, error_message)
142
+ end
143
+
144
+ it "should complain if a text ha&s nested opening chevrons" do
145
+ sample_text = 'begin <<some_tag> > end'
146
+ error_message = "Nested opening chevron '<'."
147
+ lambda { Engine::parse(sample_text) }.should raise_error(StandardError, error_message)
148
+ end
137
149
 
138
150
  end # context
139
151
 
@@ -166,12 +178,22 @@ SNIPPET
166
178
  context "Provided services" do
167
179
 
168
180
  it "should know the variable(s) it contains" do
181
+ # Case using the sample template
169
182
  subject.variables == [:userid, :password]
170
183
 
171
184
  # Case of an empty source template text
172
185
  instance = Engine.new ''
173
186
  instance.variables.should be_empty
174
187
  end
188
+
189
+
190
+ it "should ignore variables/placeholders in comments" do
191
+ substeps = " # Comment 1 <miscellaneous>\n" + sample_template
192
+ substeps += " #\n Comment 2 <haphazard>"
193
+ instance = Engine.new substeps
194
+ subject.variables == [:userid, :password]
195
+ end
196
+
175
197
 
176
198
  it "should render the text given the actuals" do
177
199
  locals = {'userid' => "johndoe"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macros4cuke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-04 00:00:00.000000000 Z
12
+ date: 2013-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber