Class: Cypress::ScenarioBank
- Inherits:
-
Object
- Object
- Cypress::ScenarioBank
- Defined in:
- lib/cypress/scenario_bank.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
- #boot ⇒ Object
-
#initialize ⇒ ScenarioBank
constructor
A new instance of ScenarioBank.
- #load ⇒ Object
- #scenario(name, &block) ⇒ Object
Constructor Details
#initialize ⇒ ScenarioBank
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 |
#boot ⇒ Object
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 |
#load ⇒ Object
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 |