Sha256: 99d4ba3cb51edea4d86f6cb780a9fcb4e35f907b209ef711b319c18aa597742e

Contents?: true

Size: 800 Bytes

Versions: 5

Compression:

Stored size: 800 Bytes

Contents

require 'spec_helper'

describe Checker::Modules::Javascript do
  it 'should only check .js files' do
    files = ['a.rb', 'b.js.erb', 'c.r', 'd.yml', 'e.yaml', 'f.coffee', 'g.haml', 'h.js']
    mod = Checker::Modules::Javascript.new(files)
    mod.stub(:check_for_executable).and_return(true)
    mod.should_receive(:check_one_file).with('h.js').and_return(true)
    mod.should_not_receive(:check_one_file).with('g.haml')
    mod.should_not_receive(:check_one_file).with('f.coffee')
    mod.should_not_receive(:check_one_file).with('e.yaml')
    mod.should_not_receive(:check_one_file).with('d.yml')
    mod.should_not_receive(:check_one_file).with('a.rb')
    mod.should_not_receive(:check_one_file).with('b.js.erb')
    mod.should_not_receive(:check_one_file).with('c.r')
    mod.check 
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
checker-0.6.4 spec/checker/modules/javascript_spec.rb
checker-0.6.3 spec/checker/modules/javascript_spec.rb
checker-0.6.2 spec/checker/modules/javascript_spec.rb
checker-0.6.1 spec/checker/modules/javascript_spec.rb
checker-0.0.6 spec/checker/modules/javascript_spec.rb