Class: FlakeySpecCatcher::RerunCapsule
- Inherits:
-
Object
- Object
- FlakeySpecCatcher::RerunCapsule
- Includes:
- Comparable
- Defined in:
- lib/flakey_spec_catcher/rerun_capsule.rb
Overview
RerunCapsule class
Contains one file or test case to re-run, as well as its associated RSpec usage.
Instance Attribute Summary collapse
-
#testcase ⇒ Object
readonly
Returns the value of attribute testcase.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #default_usage? ⇒ Boolean
- #empty? ⇒ Boolean
-
#initialize(usage: nil, testcase: []) ⇒ RerunCapsule
constructor
A new instance of RerunCapsule.
Constructor Details
#initialize(usage: nil, testcase: []) ⇒ RerunCapsule
Returns a new instance of RerunCapsule.
12 13 14 15 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 12 def initialize(usage: nil, testcase: []) @usage = initialize_usage(usage) @testcase = initialize_testcase(testcase) end |
Instance Attribute Details
#testcase ⇒ Object (readonly)
Returns the value of attribute testcase.
10 11 12 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 10 def testcase @testcase end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
10 11 12 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 10 def usage @usage end |
Instance Method Details
#<=>(other) ⇒ Object
29 30 31 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 29 def <=>(other) @testcase <=> other.testcase end |
#==(other) ⇒ Object
33 34 35 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 33 def ==(other) usage == other.usage && testcase == other.testcase end |
#default_usage? ⇒ Boolean
25 26 27 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 25 def default_usage? @usage.nil? end |
#empty? ⇒ Boolean
17 18 19 20 21 22 23 |
# File 'lib/flakey_spec_catcher/rerun_capsule.rb', line 17 def empty? if testcase.empty? true else false end end |