spec/macros4cuke/use-sample-collection.rb in macros4cuke-0.4.08 vs spec/macros4cuke/use-sample-collection.rb in macros4cuke-0.4.09
- old
+ new
@@ -1,15 +1,15 @@
-# File: sample-collection.rb
+# File: use-sample-collection.rb
# Purpose: mix-in module with helper methods to build a sample
# collection of macro-steps.
require_relative '../../lib/macros4cuke/macro-collection'
module Macros4Cuke # Open this namespace to avoid module qualifier prefixes
# Mix-in module.
-# Defines a set of methods that builds for testing purposes
+# Defines a set of methods that builds for testing purposes
# a sample collection of macro-steps.
module UseSampleCollection
# Phrase of first macro-step in the collection.
SamplePhrase1 = 'enter my credentials as <userid>'
@@ -26,11 +26,11 @@
snippet
end
# Phrase of second macro-step in the collection.
SamplePhrase2 = 'fill in the form with'
-
+
# Sub-steps of the second macro-step in the collection.
SampleSubsteps2 = begin
snippet = <<-SNIPPET
When I fill in "first_name" with "<firstname>"
And I fill in "last_name" with "<lastname>"
@@ -53,20 +53,20 @@
And I click "Save"
SNIPPET
snippet
end
- # Helper. Stuff the macro collection with sample steps.
+ # Helper. Stuff the macro collection with sample steps.
def fill_collection()
coll = MacroCollection.instance
-
+
coll.clear # Start from scratch: zap the existing macro-steps
-
+
coll.add_macro(SamplePhrase1, SampleSubsteps1, true)
coll.add_macro(SamplePhrase2, SampleSubsteps2, true)
end
-
+
# Helper. For convenience, provide a shorter name
# for the macro-step collection.
def macro_coll()
return MacroCollection.instance
end