Sha256: cbecf77b7fc0264e8fabfcb70df00358a59b70f5b649546591512763321c320c

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe RailsBestPractices::Core::Check do
  let(:check) { RailsBestPractices::Core::Check.new }

  it "should get empty interesting nodes" do
    check.interesting_nodes.should == []
  end

  it "should match all files of interesting files" do
    check.interesting_files.should == /.*/
  end

  context "node_start" do
    it "should call start_if" do
      node = stub(:sexp_type => :if)
      check.should_receive(:send).with("start_if", node)
      check.node_start(node)
    end

    it "should call start_call" do
      node = stub(:sexp_type => :call)
      check.should_receive(:send).with("start_call", node)
      check.node_start(node)
    end
  end

  context "node_end" do
    it "should call end_if" do
      node = stub(:sexp_type => :if)
      check.should_receive(:send).with("end_if", node)
      check.node_end(node)
    end

    it "should call end_call" do
      node = stub(:sexp_type => :call)
      check.should_receive(:send).with("end_call", node)
      check.node_end(node)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_best_practices-1.1.0 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-1.0.1 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-1.0.0 spec/rails_best_practices/core/check_spec.rb