implemented flog backend
[augment.git] / spec / color_backend_spec.rb
blob3fb9526b90258d14fb891db63c3db150c547918d
1 $LOAD_PATH << File.dirname(__FILE__)
2 require 'spec_helper'
4 describe Backend, " when augmenting by color" do
5   before do
6     FileUtils.cd(PROJECT_ROOT)
7     FileUtils.rm_r('lib/.augment') rescue nil
8     
9     ColoringBackend.run('lib/drink.rb')
10   end
12   it "should create .augment directory and files" do
13     File.should exist('lib/.augment')
14     File.should exist('lib/.augment/drink.rb')
15   end
16   
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']
31   end
32 end