Sha256: 5723c7f2ffad52d5cb7118ac93cc07dfad93a6f83faf01a80fe5d0e5999164d4
Contents?: true
Size: 1.21 KB
Versions: 7
Compression:
Stored size: 1.21 KB
Contents
require "spec_helper" module Chanko describe Loader do describe ".load" do after do described_class.cache.clear end context "when existent unit name is passed" do it "loads unit in units directory and returns the Module" do described_class.load(:example_unit).should == ExampleUnit end end context "when non-existent unit name is passed" do it "returns nil" do described_class.load(:non_existent_unit).should == nil end end context "when loader has ever loaded specified unit" do it "load unit from cache" do described_class.any_instance.should_receive(:load_from_file).and_call_original described_class.load(:example_unit) described_class.load(:example_unit) end end context "when loader has ever loaded specified wrong unit" do before do described_class.cache.clear end it "load unit from cache" do described_class.any_instance.should_receive(:load_from_file).and_call_original described_class.load(:non_existent_unit) described_class.load(:non_existent_unit) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems