Class: JasmineNodeRunner
- Inherits:
-
Object
- Object
- JasmineNodeRunner
- Defined in:
- lib/tasks/jasmine_node/jasmine_node_runner.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(node, spec_dir, dir, filter) ⇒ JasmineNodeRunner
constructor
A new instance of JasmineNodeRunner.
-
#is_configured?(all_files) ⇒ Boolean
TODO: Only return true if we can find the node binary.
- #name ⇒ Object
- #should_run?(modified_files) ⇒ Boolean
Constructor Details
#initialize(node, spec_dir, dir, filter) ⇒ JasmineNodeRunner
Returns a new instance of JasmineNodeRunner.
3 4 5 6 7 8 |
# File 'lib/tasks/jasmine_node/jasmine_node_runner.rb', line 3 def initialize(node, spec_dir, dir, filter) @node = node @spec_dir = spec_dir @dir = dir @filter = filter end |
Instance Method Details
#execute ⇒ Object
14 15 16 |
# File 'lib/tasks/jasmine_node/jasmine_node_runner.rb', line 14 def execute return `#{@node} #{@spec_dir}/specs.js --noColor #{@dir} 2>&1` end |
#is_configured?(all_files) ⇒ Boolean
TODO: Only return true if we can find the node binary
19 20 21 22 |
# File 'lib/tasks/jasmine_node/jasmine_node_runner.rb', line 19 def is_configured?(all_files) spec_filter = StartsWithFilter.new(@dir) return !(all_files.detect { |file| spec_filter.filter(file) }).nil? end |
#name ⇒ Object
10 11 12 |
# File 'lib/tasks/jasmine_node/jasmine_node_runner.rb', line 10 def name return 'Jasmine' end |
#should_run?(modified_files) ⇒ Boolean
24 25 26 |
# File 'lib/tasks/jasmine_node/jasmine_node_runner.rb', line 24 def should_run?(modified_files) return !(modified_files.detect { |file| @filter.filter(file) }).nil? end |