Sha256: d666348ff202e91bbdd51d4f0acf0289e98757837e0ef819f62c77ae62c70c47

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

class JasmineNodeRunner
  
  def initialize(node, spec_dir, dir, filter)
    @node = node
    @spec_dir = spec_dir
    @dir = dir
    @filter = filter
  end
  
  def name
    return 'Jasmine'
  end
  
  def execute
    return `#{@node} #{@spec_dir}/specs.js --noColor #{@dir}  2>&1`
  end
  
  # TODO: Only return true if we can find the node binary
  def is_configured?(all_files)
    spec_filter = StartsWithFilter.new(@dir + '/spec/')
    return !(all_files.detect { |file| spec_filter.filter(file) }).nil?
  end
  
  def should_run?(modified_files)
    return !(modified_files.detect { |file| @filter.filter(file) }).nil?
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loris-0.2.2 lib/tasks/jasmine_node/jasmine_node_runner.rb
loris-0.2.1 lib/tasks/jasmine_node/jasmine_node_runner.rb
loris-0.2.0 lib/tasks/jasmine_node/jasmine_node_runner.rb