Class: Assert::CLIRunner
- Inherits:
-
Object
- Object
- Assert::CLIRunner
- Defined in:
- lib/assert/cli.rb
Constant Summary collapse
- TEST_FILE_SUFFIXES =
['_tests.rb', '_test.rb']
Instance Attribute Summary collapse
-
#test_files ⇒ Object
readonly
Returns the value of attribute test_files.
Instance Method Summary collapse
-
#initialize(*args) ⇒ CLIRunner
constructor
A new instance of CLIRunner.
- #run ⇒ Object
Constructor Details
#initialize(*args) ⇒ CLIRunner
Returns a new instance of CLIRunner.
53 54 55 56 57 58 59 60 |
# File 'lib/assert/cli.rb', line 53 def initialize(*args) , test_paths = [ args.last.kind_of?(::Hash) ? args.pop : {}, args ] @test_files = file_paths(test_paths).select{ |f| test_file?(f) } end |
Instance Attribute Details
#test_files ⇒ Object (readonly)
Returns the value of attribute test_files.
51 52 53 |
# File 'lib/assert/cli.rb', line 51 def test_files @test_files end |
Instance Method Details
#run ⇒ Object
62 63 64 65 |
# File 'lib/assert/cli.rb', line 62 def run @test_files.each{ |file| require file } require 'assert' if @test_files.empty? # show empty test output end |