Sha256: dd0981ded957c4f54efdc35a1a3e4213f03f7f18019e329a26af8701d872f648

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(: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

3 entries across 3 versions & 1 rubygems

Version Path
rails_best_practices-0.7.1 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.7.0 spec/rails_best_practices/core/check_spec.rb
rails_best_practices-0.6.7 spec/rails_best_practices/core/check_spec.rb