Class: Booth::Testing::Support::Scenario

Inherits:
Object
  • Object
show all
Defined in:
lib/booth/testing/support/scenario.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ Scenario

Returns a new instance of Scenario.



9
10
11
# File 'lib/booth/testing/support/scenario.rb', line 9

def initialize(klass)
  @klass = klass
end

Instance Attribute Details

#after_credentialObject

Returns the value of attribute after_credential.



7
8
9
# File 'lib/booth/testing/support/scenario.rb', line 7

def after_credential
  @after_credential
end

#before_testObject

Returns the value of attribute before_test.



7
8
9
# File 'lib/booth/testing/support/scenario.rb', line 7

def before_test
  @before_test
end

#routing_namespaceObject

Returns the value of attribute routing_namespace.



7
8
9
# File 'lib/booth/testing/support/scenario.rb', line 7

def routing_namespace
  @routing_namespace
end

#scopeObject

Returns the value of attribute scope.



7
8
9
# File 'lib/booth/testing/support/scenario.rb', line 7

def scope
  @scope
end

Instance Method Details

#callObject



17
18
19
# File 'lib/booth/testing/support/scenario.rb', line 17

def call
  @klass.call routing_namespace:, scope:, before_test:, after_credential:
end

#nameObject



13
14
15
# File 'lib/booth/testing/support/scenario.rb', line 13

def name
  @klass.to_s.underscore.parameterize(separator: '_')
end