Class: TestRunner::Test
- Inherits:
-
Object
- Object
- TestRunner::Test
- Defined in:
- lib/test-runner/test.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#expect_failure ⇒ Object
readonly
Returns the value of attribute expect_failure.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #file_path ⇒ Object
-
#initialize(**opts) ⇒ Test
constructor
A new instance of Test.
- #path_matches?(pattern) ⇒ Boolean
- #template? ⇒ Boolean
Constructor Details
#initialize(**opts) ⇒ Test
Returns a new instance of Test.
6 7 8 9 10 11 12 13 14 |
# File 'lib/test-runner/test.rb', line 6 def initialize(**opts) @path = opts[:path] @type = opts[:type] @template = opts[:template] @args = opts[:args] @name = opts[:name] @description = opts[:description] @expect_failure = opts[:expect_failure] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def args @args end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def description @description end |
#expect_failure ⇒ Object (readonly)
Returns the value of attribute expect_failure.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def expect_failure @expect_failure end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def path @path end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def template @template end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/test-runner/test.rb', line 3 def type @type end |
Instance Method Details
#file_path ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/test-runner/test.rb', line 25 def file_path if template? "#{template}.nix" else "#{path}.nix" end end |
#path_matches?(pattern) ⇒ Boolean
17 18 19 |
# File 'lib/test-runner/test.rb', line 17 def path_matches?(pattern) File.fnmatch?(pattern, path, File::FNM_EXTGLOB) end |
#template? ⇒ Boolean
21 22 23 |
# File 'lib/test-runner/test.rb', line 21 def template? type == 'template' end |