From edf8849d6a7cb9e66514952a6a2986645cd88e0e Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Wed, 20 Jan 2021 22:30:04 +0900 Subject: [PATCH] Add test run_as_executable --- test/youplot_test.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/youplot_test.rb b/test/youplot_test.rb index f6e41fb..d94e3e5 100644 --- a/test/youplot_test.rb +++ b/test/youplot_test.rb @@ -3,7 +3,19 @@ require_relative 'test_helper' class YouPlotTest < Test::Unit::TestCase - def test_that_it_has_a_version_number + def teardown + YouPlot.run_as_executable = false + end + + test :it_has_a_version_number do assert_kind_of String, ::YouPlot::VERSION end + + test :run_as_executable do + assert_equal false, YouPlot.run_as_executable + assert_equal false, YouPlot.run_as_executable? + YouPlot.run_as_executable = true + assert_equal true, YouPlot.run_as_executable + assert_equal true, YouPlot.run_as_executable? + end end