Class: JSpecRunner
- Inherits:
-
Object
- Object
- JSpecRunner
- Defined in:
- lib/tasks/jspec/jspec_runner.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(dir, filter) ⇒ JSpecRunner
constructor
A new instance of JSpecRunner.
- #is_configured?(all_files) ⇒ Boolean
- #name ⇒ Object
- #should_run?(modified_files) ⇒ Boolean
Constructor Details
#initialize(dir, filter) ⇒ JSpecRunner
Returns a new instance of JSpecRunner.
3 4 5 6 7 |
# File 'lib/tasks/jspec/jspec_runner.rb', line 3 def initialize(dir, filter) @config = dir + '/spec/spec.rhino.js' @dir = dir @filter = filter end |
Instance Method Details
#execute ⇒ Object
13 14 15 |
# File 'lib/tasks/jspec/jspec_runner.rb', line 13 def execute return `jspec run --rhino --trace 2>&1` end |
#is_configured?(all_files) ⇒ Boolean
17 18 19 |
# File 'lib/tasks/jspec/jspec_runner.rb', line 17 def is_configured?(all_files) return all_files.include?(@config) end |
#name ⇒ Object
9 10 11 |
# File 'lib/tasks/jspec/jspec_runner.rb', line 9 def name return 'JSpec' end |
#should_run?(modified_files) ⇒ Boolean
21 22 23 |
# File 'lib/tasks/jspec/jspec_runner.rb', line 21 def should_run?(modified_files) return !(modified_files.detect { |file| @filter.filter(file) }).nil? end |