Class: Guard::SporkMinitest::Runner
- Inherits:
-
Object
- Object
- Guard::SporkMinitest::Runner
- Defined in:
- lib/guard/sporkminitest/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
- #cli_options ⇒ Object
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run(paths, options = {}) ⇒ Object
- #test_file_patterns ⇒ Object
- #test_folders ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/guard/sporkminitest/runner.rb', line 14 def initialize( = {}) @options = { :test_folders => %w[test spec], :test_file_patterns => %w[*_test.rb test_*.rb *_spec.rb], :cli => '' }.merge() [:test_folders, :test_file_patterns].each do |k| @options[k] = Array(@options[k]).uniq.compact end end |
Class Method Details
Instance Method Details
#cli_options ⇒ Object
32 33 34 |
# File 'lib/guard/sporkminitest/runner.rb', line 32 def @options[:cli] ||= '' end |
#run(paths, options = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/guard/sporkminitest/runner.rb', line 26 def run(paths, = {}) = [:message] || "Running: #{paths.join(' ')}" UI.info , :reset => true system 'testdrb', *paths end |
#test_file_patterns ⇒ Object
40 41 42 |
# File 'lib/guard/sporkminitest/runner.rb', line 40 def test_file_patterns @options[:test_file_patterns] end |
#test_folders ⇒ Object
36 37 38 |
# File 'lib/guard/sporkminitest/runner.rb', line 36 def test_folders @options[:test_folders] end |