Class: Waw::WSpec::Scenario
Instance Attribute Summary collapse
-
#assertion_count ⇒ Object
readonly
Number of assertions done.
-
#browser ⇒ Object
readonly
The browser instance underlying this scenario.
-
#name ⇒ Object
readonly
The scenario name.
Instance Method Summary collapse
-
#add_assertion ⇒ Object
Adds an assertion.
-
#initialize(name, &block) ⇒ Scenario
constructor
Creates a scenario instance.
-
#run(waw_kernel) ⇒ Object
Run the test scenario.
Constructor Details
#initialize(name, &block) ⇒ Scenario
Creates a scenario instance
16 17 18 19 20 21 |
# File 'lib/waw/wspec/scenario.rb', line 16 def initialize(name, &block) @name = name @browser = Browser.new @block = block @assertion_count = 0 end |
Instance Attribute Details
#assertion_count ⇒ Object (readonly)
Number of assertions done
13 14 15 |
# File 'lib/waw/wspec/scenario.rb', line 13 def assertion_count @assertion_count end |
#browser ⇒ Object (readonly)
The browser instance underlying this scenario
10 11 12 |
# File 'lib/waw/wspec/scenario.rb', line 10 def browser @browser end |
#name ⇒ Object (readonly)
The scenario name
7 8 9 |
# File 'lib/waw/wspec/scenario.rb', line 7 def name @name end |
Instance Method Details
#add_assertion ⇒ Object
Adds an assertion
24 25 26 |
# File 'lib/waw/wspec/scenario.rb', line 24 def add_assertion @assertion_count += 1 end |
#run(waw_kernel) ⇒ Object
Run the test scenario
29 30 31 |
# File 'lib/waw/wspec/scenario.rb', line 29 def run(waw_kernel) DSL.new(waw_kernel, self).__execute(&@block) end |