$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib') require 'spec' require 'buildmaster/cotta' require 'buildmaster/cotta/in_memory_system' module BuildMaster context 'Cotta' do setup do @system = InMemorySystem.new @cotta = Cotta.new(@system) end specify 'shell out command to system' do @cotta.shell('shell command') @system.executed_commands.length.should_equal 1 @system.executed_commands[0].should_equal 'shell command' end specify 'instantiate dir from cotta' do dir = @cotta.dir('dirname') dir.name.should_equal 'dirname' end specify 'instantiate file from cotta' do file = @cotta.file('one/two/three.txt') file.name.should_equal 'three.txt' file.parent.name.should_equal 'two' end end end