Class: Guard::Minitest::Runner
- Inherits:
-
Object
- Object
- Guard::Minitest::Runner
- Defined in:
- lib/guard/minitest/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bundler? ⇒ Boolean
- #cli_options ⇒ Object
- #drb? ⇒ Boolean
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #notify? ⇒ Boolean
- #rubygems? ⇒ Boolean
- #run(paths, options = {}) ⇒ Object
- #test_file_patterns ⇒ Object
- #test_folders ⇒ Object
- #verbose? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/guard/minitest/runner.rb', line 14 def initialize( = {}) () @options = { :bundler => File.exist?("#{Dir.pwd}/Gemfile"), :rubygems => false, :drb => false, :test_folders => %w[test spec], :test_file_patterns => %w[*_test.rb test_*.rb *_spec.rb], :cli => '' }.merge() [:test_folders,:test_file_patterns].each {|k| (@options[k]= [@options[k]].flatten.uniq.compact).freeze} = .freeze end |
Class Method Details
Instance Method Details
#bundler? ⇒ Boolean
47 48 49 |
# File 'lib/guard/minitest/runner.rb', line 47 def bundler? @options[:bundler] end |
#cli_options ⇒ Object
35 36 37 |
# File 'lib/guard/minitest/runner.rb', line 35 def @options[:cli] ||= '' end |
#drb? ⇒ Boolean
55 56 57 |
# File 'lib/guard/minitest/runner.rb', line 55 def drb? @options[:drb] end |
#notify? ⇒ Boolean
43 44 45 |
# File 'lib/guard/minitest/runner.rb', line 43 def notify? !!@options[:notification] end |
#rubygems? ⇒ Boolean
51 52 53 |
# File 'lib/guard/minitest/runner.rb', line 51 def rubygems? !bundler? && @options[:rubygems] end |
#run(paths, options = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/guard/minitest/runner.rb', line 29 def run(paths, = {}) = [:message] || "Running: #{paths.join(' ')}" UI.info , :reset => true system(minitest_command(paths)) end |
#test_file_patterns ⇒ Object
63 64 65 |
# File 'lib/guard/minitest/runner.rb', line 63 def test_file_patterns @options[:test_file_patterns] end |
#test_folders ⇒ Object
59 60 61 |
# File 'lib/guard/minitest/runner.rb', line 59 def test_folders @options[:test_folders] end |
#verbose? ⇒ Boolean
39 40 41 |
# File 'lib/guard/minitest/runner.rb', line 39 def verbose? @options[:cli].include?('--verbose') end |