Class: Waw::WSpec::Scenario

Inherits:
Object show all
Defined in:
lib/waw/wspec/scenario.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject (readonly)

Number of assertions done



13
14
15
# File 'lib/waw/wspec/scenario.rb', line 13

def assertion_count
  @assertion_count
end

#browserObject (readonly)

The browser instance underlying this scenario



10
11
12
# File 'lib/waw/wspec/scenario.rb', line 10

def browser
  @browser
end

#nameObject (readonly)

The scenario name



7
8
9
# File 'lib/waw/wspec/scenario.rb', line 7

def name
  @name
end

Instance Method Details

#add_assertionObject

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