Class: Testcase
- Inherits:
-
Object
- Object
- Testcase
- Defined in:
- lib/testcase.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response_expectation ⇒ Object
readonly
Returns the value of attribute response_expectation.
-
#wait_before_request ⇒ Object
readonly
Returns the value of attribute wait_before_request.
Class Method Summary collapse
-
.expand_specs(specs, configuration) ⇒ Object
creates an array of spec hashes by calling priorize, partition and explode_iterations to prepare the specs, automagically create the ierting ones and partition them.
Instance Method Summary collapse
-
#initialize(raw, substitution) ⇒ Testcase
constructor
A new instance of Testcase.
-
#unique_identifier ⇒ Object
returns an identifier of that testcase that should be unique.
Constructor Details
#initialize(raw, substitution) ⇒ Testcase
Returns a new instance of Testcase.
7 8 9 10 11 12 13 14 |
# File 'lib/testcase.rb', line 7 def initialize(raw, substitution) @raw = raw @name = raw['name'] @request = @raw['request'] @response_expectation = @raw['response_expectation'] @wait_before_request = @raw['wait_before_request'].nil? ? 0 : @raw['wait_before_request'] create_resource_substitutes(substitution) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/testcase.rb', line 4 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
4 5 6 |
# File 'lib/testcase.rb', line 4 def raw @raw end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/testcase.rb', line 4 def request @request end |
#response_expectation ⇒ Object (readonly)
Returns the value of attribute response_expectation.
4 5 6 |
# File 'lib/testcase.rb', line 4 def response_expectation @response_expectation end |
#wait_before_request ⇒ Object (readonly)
Returns the value of attribute wait_before_request.
4 5 6 |
# File 'lib/testcase.rb', line 4 def wait_before_request @wait_before_request end |
Class Method Details
.expand_specs(specs, configuration) ⇒ Object
creates an array of spec hashes by calling priorize, partition and explode_iterations to prepare the specs, automagically create the ierting ones and partition them
18 19 20 21 |
# File 'lib/testcase.rb', line 18 def self.(specs, configuration) @@configuration = configuration objectize(partition(explode_iterations(priorize(specs)))) end |
Instance Method Details
#unique_identifier ⇒ Object
returns an identifier of that testcase that should be unique
24 25 26 |
# File 'lib/testcase.rb', line 24 def unique_identifier Digest::MD5.hexdigest(@name.to_s)[0..9] end |