Class: MesaTestCase
- Inherits:
-
Object
- Object
- MesaTestCase
- Defined in:
- lib/mesa_test.rb
Instance Attribute Summary collapse
-
#mesa ⇒ Object
readonly
Returns the value of attribute mesa.
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
-
#test_name ⇒ Object
readonly
Returns the value of attribute test_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#do_one ⇒ Object
just punt to
each_test_runin the test_suite directory. -
#initialize(test: nil, mesa: nil, mod: nil, position: nil) ⇒ MesaTestCase
constructor
A new instance of MesaTestCase.
- #results_hash ⇒ Object
- #test_case_dir ⇒ Object
- #test_suite_dir ⇒ Object
Constructor Details
#initialize(test: nil, mesa: nil, mod: nil, position: nil) ⇒ MesaTestCase
Returns a new instance of MesaTestCase.
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
# File 'lib/mesa_test.rb', line 792 def initialize(test: nil, mesa: nil, mod: nil, position: nil) @test_name = test @mesa = mesa unless MesaTestCase.modules.include? mod raise TestCaseDirError, "Invalid module: #{mod}. Must be one of: " + MesaTestCase.modules.join(', ') end @mod = mod @position = position # way to output colored text to shell @shell = Thor::Shell::Color.new # validate stuff check_mesa_dir check_test_case end |
Instance Attribute Details
#mesa ⇒ Object (readonly)
Returns the value of attribute mesa.
786 787 788 |
# File 'lib/mesa_test.rb', line 786 def mesa @mesa end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
786 787 788 |
# File 'lib/mesa_test.rb', line 786 def mod @mod end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
786 787 788 |
# File 'lib/mesa_test.rb', line 786 def position @position end |
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
786 787 788 |
# File 'lib/mesa_test.rb', line 786 def shell @shell end |
#test_name ⇒ Object (readonly)
Returns the value of attribute test_name.
786 787 788 |
# File 'lib/mesa_test.rb', line 786 def test_name @test_name end |
Class Method Details
.modules ⇒ Object
788 789 790 |
# File 'lib/mesa_test.rb', line 788 def self.modules %i[star binary astero] end |
Instance Method Details
#do_one ⇒ Object
just punt to each_test_run in the test_suite directory. It’s your problem now, sucker!
821 822 823 824 825 826 |
# File 'lib/mesa_test.rb', line 821 def do_one shell.say("Testing #{test_name}", :yellow) visit_dir(test_suite_dir) do bash_execute("./each_test_run #{position}") end end |
#results_hash ⇒ Object
828 829 830 831 832 833 834 835 |
# File 'lib/mesa_test.rb', line 828 def results_hash testhub_file = File.join(test_case_dir, 'testhub.yml') unless File.exist?(testhub_file) raise TestCaseDirError.new('No results found for test case '\ "#{test_name}.") end YAML.safe_load(File.read(testhub_file), [Symbol]) end |
#test_case_dir ⇒ Object
815 816 817 |
# File 'lib/mesa_test.rb', line 815 def test_case_dir File.join(test_suite_dir, test_name) end |
#test_suite_dir ⇒ Object
811 812 813 |
# File 'lib/mesa_test.rb', line 811 def test_suite_dir mesa.test_suite_dir(mod: @mod) end |