Class: Cypress::ScenarioBank

Inherits:
Object
  • Object
show all
Defined in:
lib/cypress/scenario_bank.rb

Instance Method Summary collapse

Constructor Details

#initializeScenarioBank

Returns a new instance of ScenarioBank.



3
4
5
# File 'lib/cypress/scenario_bank.rb', line 3

def initialize
  @scenarios = {}
end

Instance Method Details

#[](name) ⇒ Object



24
25
26
# File 'lib/cypress/scenario_bank.rb', line 24

def [](name)
  @scenarios[name.to_sym]
end

#bootObject



7
8
9
10
11
12
# File 'lib/cypress/scenario_bank.rb', line 7

def boot
  if Cypress.configuration.test_framework == :rspec
    require 'rspec/rails'
    extend RSpec::Mocks::ExampleMethods
  end
end

#loadObject



14
15
16
17
18
# File 'lib/cypress/scenario_bank.rb', line 14

def load
  Dir['./spec/cypress/scenarios/**/*.rb'].each do |f|
    instance_eval(File.read(f), f)
  end
end

#scenario(name, &block) ⇒ Object



20
21
22
# File 'lib/cypress/scenario_bank.rb', line 20

def scenario(name, &block)
  @scenarios[name] = block
end