Class: SpecMate
- Inherits:
-
Object
- Object
- SpecMate
- Defined in:
- lib/rspec/mate/runner.rb
Instance Method Summary (collapse)
- - (Object) project_directory protected
- - (Object) run(stdout, options)
- - (Object) run_file(stdout, options = {})
- - (Object) run_files(stdout, options = {})
- - (Object) run_focussed(stdout, options = {})
- - (Object) single_file protected
Instance Method Details
- (Object) project_directory (protected)
62 63 64 |
# File 'lib/rspec/mate/runner.rb', line 62 def project_directory File.(ENV['TM_PROJECT_DIRECTORY']) end |
- (Object) run(stdout, options)
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rspec/mate/runner.rb', line 43 def run(stdout, ) formatter = ENV['TM_RSPEC_FORMATTER'] || 'RSpec::Core::Formatter::WebKit' argv = [] argv += ENV['TM_RSPEC_OPTS'].split(" ") if ENV['TM_RSPEC_OPTS'] argv += [:files].dup argv << '--format' << formatter argv << '--line' << [:line] if [:line] Dir.chdir(ENV['TM_PROJECT_DIRECTORY']) do ::RSpec::Core::CommandLine.run(RSpec::Core::OptionParser.parse(argv, STDERR, stdout)) end end |
- (Object) run_file(stdout, options = {})
33 34 35 36 |
# File 'lib/rspec/mate/runner.rb', line 33 def run_file(stdout, ={}) .merge!({:files => [single_file]}) run(stdout, ) end |
- (Object) run_files(stdout, options = {})
25 26 27 28 29 30 31 |
# File 'lib/rspec/mate/runner.rb', line 25 def run_files(stdout, ={}) files = ENV['TM_SELECTED_FILES'].split(" ").map do |path| File.(path[1..-2]) end .merge!({:files => files}) run(stdout, ) end |
- (Object) run_focussed(stdout, options = {})
38 39 40 41 |
# File 'lib/rspec/mate/runner.rb', line 38 def run_focussed(stdout, ={}) .merge!({:files => [single_file], :line => ENV['TM_LINE_NUMBER']}) run(stdout, ) end |
- (Object) single_file (protected)
58 59 60 |
# File 'lib/rspec/mate/runner.rb', line 58 def single_file File.(ENV['TM_FILEPATH']) end |