Class: Smartest::FixtureDefinition
- Inherits:
-
Object
- Object
- Smartest::FixtureDefinition
- Defined in:
- lib/smartest/fixture_definition.rb
Constant Summary collapse
- VALID_SCOPES =
%i[test suite].freeze
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(name:, block:, location:, scope: :test) ⇒ FixtureDefinition
constructor
A new instance of FixtureDefinition.
Constructor Details
#initialize(name:, block:, location:, scope: :test) ⇒ FixtureDefinition
Returns a new instance of FixtureDefinition.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/smartest/fixture_definition.rb', line 9 def initialize(name:, block:, location:, scope: :test) raise ArgumentError, "fixture name is required" if name.nil? || name.to_s.empty? raise ArgumentError, "fixture block is required" unless block @name = name.to_sym @block = block @location = location @scope = normalize_scope(scope) @dependencies = ParameterExtractor.required_keyword_names(block, usage: :fixture) end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
7 8 9 |
# File 'lib/smartest/fixture_definition.rb', line 7 def block @block end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
7 8 9 |
# File 'lib/smartest/fixture_definition.rb', line 7 def dependencies @dependencies end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/smartest/fixture_definition.rb', line 7 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/smartest/fixture_definition.rb', line 7 def name @name end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'lib/smartest/fixture_definition.rb', line 7 def scope @scope end |