Sha256: b720e43ad4b0b3ca3cc1b680cdba346dbd32a3778b93ffb7cef48ce1f3c94c01

Contents?: true

Size: 958 Bytes

Versions: 4

Compression:

Stored size: 958 Bytes

Contents

#
# Bolt::Runner
#
# The Runner maps the changed file to the appropriate test file and runs it
#
module Bolt
  class Runner
    attr_accessor :selected, :notifier
    
    # Constructor
    def initialize 
      # find appropriate runner
      runner
      
      $stdout.puts "** Using #{selected.class} \n"
    end
    
    # Pick a listener to launch
    def runner
      return selected if selected
      
      if Bolt['runner'] and ['test_unit', 'rspec'].include?(Bolt['runner'])
        self.selected= Bolt::Runners::TestUnit.new if Bolt['runner'] == 'test_unit'
        self.selected= Bolt::Runners::RSpec.new if Bolt['runner'] == 'rspec'
        $stdout.puts "** Found 'runner' setting in .bolt"
        return self.selected
      end
      $stdout.puts "** Determining runner... \n"
      self.selected= Bolt::Runners::TestUnit.new
      self.selected= Bolt::Runners::RSpec.new  if File.directory?('spec')
      self.selected
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
marcinbunsch-bolt-0.2.0 lib/bolt/runner.rb
marcinbunsch-bolt-0.2.1 lib/bolt/runner.rb
marcinbunsch-bolt-0.2.2 lib/bolt/runner.rb
marcinbunsch-bolt-0.2.3 lib/bolt/runner.rb