Sha256: bf2a6f3b8e31447cdf18f29d88a658bcf1ee1b2f86df2f4a2ba1bbea7dddc4a7

Contents?: true

Size: 1.06 KB

Versions: 11

Compression:

Stored size: 1.06 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 == RailsBestPractices::Core::Check::NODE_TYPES
  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(:node_type => :if)
      check.should_receive(:send).with("start_if", node)
      check.node_start(node)
    end

    it "should call start_call" do
      node = stub(:node_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(:node_type => :if)
      check.should_receive(:send).with("end_if", node)
      check.node_end(node)
    end

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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rails_best_practices-0.10.1 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.10.0 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-raydog153-0.9.1 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.9.0 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.8.2 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.8.1 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.8.0 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.7.5 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.7.4 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.7.3 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.7.2 spec/rails_best_practices/core/check_spec.rb