Sha256: 14c4263d5075ec68fadeec2aa0a9688706149f93a6873ff630122e976335554c

Contents?: true

Size: 809 Bytes

Versions: 2

Compression:

Stored size: 809 Bytes

Contents

require "spec_helper"

describe Checker::Modules::Ruby do
  it "should only check .rb files" do
    files = ["a.rb", "b.js.erb", "c.r"]
    mod = Checker::Modules::Ruby.new(files)
    allow(mod).to receive(:check_one_file).and_return(double(success?: true, status: :ok))
    expect(mod).to receive(:check_one_file).with("a.rb")
    expect(mod).not_to receive(:check_one_file).with("b.js.erb")
    expect(mod).not_to receive(:check_one_file).with("c.r")
    mod.check
  end

  it "should pass the syntax check" do
    files = [fixture("ruby", "good.rb")]
    mod = Checker::Modules::Ruby.new(files)
    expect(mod.check).to be true
  end

  it "should not pass the syntax check" do
    files = [fixture("ruby", "bad.rb")]
    mod = Checker::Modules::Ruby.new(files)
    expect(mod.check).to be false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
checker-0.8.0.beta2 spec/checker/modules/ruby_spec.rb
checker-0.8.0.beta spec/checker/modules/ruby_spec.rb