Sha256: 354907bb32fcc2b15e01a7407b0a3a11f63f1213e044bd368d44801d81acb7a4
Contents?: true
Size: 1.53 KB
Versions: 14
Compression:
Stored size: 1.53 KB
Contents
require File.expand_path("../spec_helper", File.dirname(__FILE__)) describe Sprinkle::Script, 'class' do it 'should define a entry point into the system' do Sprinkle::Script.should respond_to(:sprinkle) end end describe Sprinkle::Script, 'when given a script' do before do @script = 'script' @filename = 'filename' @sprinkle = Sprinkle::Script.new Sprinkle::Script.stub!(:new).and_return(@sprinkle) end it 'should create a new sprinkle instance' do Sprinkle::Script.should_receive(:new).and_return(@sprinkle) Sprinkle::Script.sprinkle @script end it 'should evaulate the sprinkle script against the instance' do @sprinkle.should_receive(:instance_eval).and_return Sprinkle::Script.sprinkle @script end it 'should specify the filename if given for line number errors' do @sprinkle.should_receive(:instance_eval).with(@script, @filename).and_return Sprinkle::Script.sprinkle @script, @filename end it 'should specify a filename of __SCRIPT__ by default if none is provided' do @sprinkle.should_receive(:instance_eval).with(@script, '__SCRIPT__').and_return Sprinkle::Script.sprinkle @script end it 'should automatically run in production mode by default' do @sprinkle.should_receive(:instance_eval).with(@script, '__SCRIPT__').and_return Sprinkle::Script.sprinkle @script end it 'should ask the Sprinkle instance to process the data from the script' do @sprinkle.should_receive(:sprinkle) Sprinkle::Script.sprinkle @script end end
Version data entries
14 entries across 14 versions & 1 rubygems