1 $LOAD_PATH << File.dirname(__FILE__)
4 describe Backend, " when augmenting by color" do
6 FileUtils.cd(PROJECT_ROOT)
7 FileUtils.rm_r('lib/.augment') rescue nil
9 ColoringBackend.run('lib/drink.rb')
12 it "should create .augment directory and files" do
13 File.should exist('lib/.augment')
14 File.should exist('lib/.augment/drink.rb')
17 it "should color the colors and ranges" do
18 layers = Layer.read('lib/drink.rb')
19 layers.size.should == 4
21 layers[0].color.should == 'black'
22 layers[1].color.should == 'green'
23 layers[2].color.should == 'red'
24 layers[3].color.should == 'white'
26 layers[0].range.should == (575 ... 580)
27 layers[1].range.should == (495 ... 500)
28 layers[2].range.should == (405 ... 408)
29 layers[3].range.should == (245 ... 250)
30 layers.map{ |l| l.backend }.uniq.should == ['coloring']