Sha256: 47b0b4b337856f67edf3a0426f5d1f929f62225206133751cc86746acd2e3772
Contents?: true
Size: 932 Bytes
Versions: 5
Compression:
Stored size: 932 Bytes
Contents
require 'spec_helper' describe Checker::Modules::Yaml do it 'should only check .yaml and .yml files' do files = ['a.rb', 'b.js.erb', 'c.r', 'd.yml', 'e.yaml'] mod = Checker::Modules::Yaml.new(files) mod.stub(:check_one_file).and_return(stub(:success? => true, :status => :ok)) mod.should_receive(:check_one_file).with('d.yml') mod.should_receive(:check_one_file).with('e.yaml') 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 it "should properly fetch yaml files" do files = [fixture("yaml", "good.yaml")] mod = Checker::Modules::Yaml.new(files) mod.check.should be_true end it "should not pass the syntax check" do files = [fixture("yaml", "bad.yaml")] mod = Checker::Modules::Yaml.new(files) mod.check.should be_false end end
Version data entries
5 entries across 5 versions & 1 rubygems