implemented flog backend
[augment.git] / spec / test_backend_spec.rb
blobd89c484e7ce99b15e86126e47efc38d04b5fa601
1 $LOAD_PATH << File.dirname(__FILE__)
3 require 'spec_helper'
5 describe TestUnitBackend, " when augmenting test results" do
6   before do
7     FileUtils.cd(PROJECT_ROOT)
8     FileUtils.rm_r('test/.augment') rescue nil
9     
10     TestUnitBackend.run('test/test_drink.rb')
11   end
12   
13   it "should color failing/erroring tests" do
14     File.should exist(Augment.augment_path('test/test_drink.rb'))
15     layers = Layer.read('test/test_drink.rb')
16     layers.first.color.should == 'red'
17     layers.last.color.should == 'yellow'
19     layers.first.range.should == (289 ... 332)
20   end
21   
22   it "should include failure message" do
23     layers = Layer.read('test/test_drink.rb')
24     layers.first.message.should =~ /bad length/
25     layers.last.message.should =~ /undefined local variable or method/
26     layers.map{ |l| l.backend }.uniq.should == ['testunit']
27   end
28 end