Class: Sevgi::Test::Script Private
- Inherits:
-
Object
- Object
- Sevgi::Test::Script
- Defined in:
- lib/sevgi/showcase/minitest/script.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Executable showcase script descriptor.
Instance Attribute Summary collapse
-
#file ⇒ String
readonly
private
Absolute script path.
Instance Method Summary collapse
-
#dir ⇒ String
private
Returns the script directory.
-
#file! ⇒ String
private
Returns the script basename.
-
#initialize(file) ⇒ void
constructor
private
Creates a script descriptor.
-
#name ⇒ String
private
Returns the script name without extension.
-
#run(*args) ⇒ Sevgi::Test::Shell::Result
private
Runs the script directly.
-
#run_passive(*args) ⇒ Sevgi::Test::Shell::Result
private
Runs the script without writing Save output to files.
-
#suite ⇒ String
private
Returns the script suite name.
-
#svg ⇒ String
private
Returns the expected SVG output path.
-
#svg! ⇒ String
private
Returns the expected SVG output basename.
-
#svg? ⇒ Boolean
private
Reports whether the expected SVG output exists.
-
#yml ⇒ String
private
Returns the optional YAML metadata path.
-
#yml! ⇒ String
private
Returns the optional YAML metadata basename.
Constructor Details
#initialize(file) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a script descriptor.
17 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 17 def initialize(file) = @file = ::File.(sanitize(file)) |
Instance Attribute Details
#file ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns absolute script path.
11 12 13 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 11 def file @file end |
Instance Method Details
#dir ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the script directory.
21 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 21 def dir = @dir ||= ::File.dirname(file) |
#file! ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the script basename.
25 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 25 def file! = ::File.basename(file) |
#name ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the script name without extension.
29 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 29 def name = @name ||= ::File.basename(file, ".*") |
#run(*args) ⇒ Sevgi::Test::Shell::Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 35 def run(*) = Shell.run(file, *) |
#run_passive(*args) ⇒ Sevgi::Test::Shell::Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
65 66 67 68 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 65 def run_passive(*) warn("...#{name}") Shell.run("sevgi", "-r", "sevgi/showcase/passive", file, *) end |
#suite ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the script suite name.
39 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 39 def suite = @suite ||= ::File.basename(dir) |
#svg ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the expected SVG output path.
47 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 47 def svg = @svg ||= ::File.("#{dir}/#{name}.svg") |
#svg! ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the expected SVG output basename.
51 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 51 def svg! = ::File.basename(svg) |
#svg? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Reports whether the expected SVG output exists.
43 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 43 def svg? = ::File.exist?(svg) |
#yml ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the optional YAML metadata path.
55 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 55 def yml = @yml ||= ::File.("#{dir}/#{name}.yml") |
#yml! ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the optional YAML metadata basename.
59 |
# File 'lib/sevgi/showcase/minitest/script.rb', line 59 def yml! = ::File.basename(yml) |