Class: TestRunner::TestScript
- Inherits:
-
Object
- Object
- TestRunner::TestScript
- Defined in:
- lib/test-runner/test_script.rb
Instance Attribute Summary collapse
- #attempts ⇒ Integer readonly
- #description ⇒ String readonly
- #expect_failure ⇒ Boolean? readonly
- #labels ⇒ Hash<String, String> readonly
- #name ⇒ String readonly
- #path ⇒ String readonly
- #tags ⇒ Array<String> readonly
- #test ⇒ Test readonly
Instance Method Summary collapse
-
#initialize(test, name, description:, expect_failure:, attempts:, tags:, labels:) ⇒ TestScript
constructor
A new instance of TestScript.
- #path_matches?(pattern) ⇒ Boolean
- #set_singleton ⇒ Object
- #singleton? ⇒ Boolean
Constructor Details
#initialize(test, name, description:, expect_failure:, attempts:, tags:, labels:) ⇒ TestScript
Returns a new instance of TestScript.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/test-runner/test_script.rb', line 27 def initialize(test, name, description:, expect_failure:, attempts:, tags:, labels:) @test = test @name = name @path = "#{test.path}##{name}" @description = description || test.description @expect_failure = expect_failure.nil? ? test.expect_failure : expect_failure @attempts = attempts || test.attempts || 1 @tags = test. + @labels = test.labels.merge(labels) @singleton = false end |
Instance Attribute Details
#attempts ⇒ Integer (readonly)
19 20 21 |
# File 'lib/test-runner/test_script.rb', line 19 def attempts @attempts end |
#description ⇒ String (readonly)
13 14 15 |
# File 'lib/test-runner/test_script.rb', line 13 def description @description end |
#expect_failure ⇒ Boolean? (readonly)
16 17 18 |
# File 'lib/test-runner/test_script.rb', line 16 def expect_failure @expect_failure end |
#labels ⇒ Hash<String, String> (readonly)
25 26 27 |
# File 'lib/test-runner/test_script.rb', line 25 def labels @labels end |
#name ⇒ String (readonly)
7 8 9 |
# File 'lib/test-runner/test_script.rb', line 7 def name @name end |
#path ⇒ String (readonly)
10 11 12 |
# File 'lib/test-runner/test_script.rb', line 10 def path @path end |
#tags ⇒ Array<String> (readonly)
22 23 24 |
# File 'lib/test-runner/test_script.rb', line 22 def @tags end |
Instance Method Details
#path_matches?(pattern) ⇒ Boolean
40 41 42 |
# File 'lib/test-runner/test_script.rb', line 40 def path_matches?(pattern) File.fnmatch?(pattern, path, File::FNM_EXTGLOB) end |
#set_singleton ⇒ Object
44 45 46 47 |
# File 'lib/test-runner/test_script.rb', line 44 def set_singleton @path = test.path @singleton = true end |
#singleton? ⇒ Boolean
49 50 51 |
# File 'lib/test-runner/test_script.rb', line 49 def singleton? @singleton end |