Sha256: 4323403845e8caf3b643e535813bf55405b080ea7ab95c33d3ce0169202ea2da
Contents?: true
Size: 1.53 KB
Versions: 12
Compression:
Stored size: 1.53 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 none 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 context "callback" do it "should add callback to start_call" do execute = false check.class.add_callback "start_call" do execute = true end node = stub(:sexp_type => :call) check.node_start(node) execute.should be_true end it "should ad callbacks to end_call" do execute = false check.class.add_callback "end_call" do execute = true end node = stub(:sexp_type => :call) check.node_end(node) execute.should be_true end end end
Version data entries
12 entries across 12 versions & 2 rubygems