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
- #all ⇒ Object
- #bundler? ⇒ Boolean
- #colour? ⇒ Boolean (also: #color?)
- #drb? ⇒ Boolean
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #notify? ⇒ Boolean
- #rubygems? ⇒ Boolean
- #run(paths, options = {}) ⇒ Object
- #seed ⇒ 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 = { :verbose => false, :notify => true, :bundler => File.exist?("#{Dir.pwd}/Gemfile"), :rubygems => false, :drb => false, :colour => false, :color => false, :all => %w{test spec} }.merge() @options[:all] = [@options[:all]].flatten end |
Class Method Details
Instance Method Details
#all ⇒ Object
35 36 37 |
# File 'lib/guard/minitest/runner.rb', line 35 def all @options[:all] end |
#bundler? ⇒ Boolean
51 52 53 |
# File 'lib/guard/minitest/runner.rb', line 51 def bundler? @options[:bundler] end |
#colour? ⇒ Boolean Also known as: color?
63 64 65 66 |
# File 'lib/guard/minitest/runner.rb', line 63 def colour? gems_can_be_loaded = rubygems? || bundler? gems_can_be_loaded && (@options[:colour] || @options[:color]) end |
#drb? ⇒ Boolean
59 60 61 |
# File 'lib/guard/minitest/runner.rb', line 59 def drb? @options[:drb] end |
#notify? ⇒ Boolean
47 48 49 |
# File 'lib/guard/minitest/runner.rb', line 47 def notify? @options[:notify] end |
#rubygems? ⇒ Boolean
55 56 57 |
# File 'lib/guard/minitest/runner.rb', line 55 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 |
#seed ⇒ Object
39 40 41 |
# File 'lib/guard/minitest/runner.rb', line 39 def seed @options[:seed] end |
#verbose? ⇒ Boolean
43 44 45 |
# File 'lib/guard/minitest/runner.rb', line 43 def verbose? @options[:verbose] end |