test short echo mode

This commit is contained in:
Josh Holtrop 2013-06-26 22:10:17 -04:00
parent 5d8e3fe1fd
commit 37d324173a

View File

@ -33,6 +33,17 @@ describe Rscons do
end end
end end
it 'supports short echo mode' do
$stdout.should_receive(:puts).once.with('CC simple.o')
$stdout.should_receive(:puts).once.with('LD simple')
setup_testdir(['simple.c']) do
env = Rscons::Environment.new(echo: :short)
env.Program('simple', 'simple.c')
File.exist?('simple.o').should be_true
`./simple`.should =~ /This is a simple C program/
end
end
it 'does not rebuild the program if no sources changed' do it 'does not rebuild the program if no sources changed' do
$stdout.should_receive(:puts).once.with('gcc -c -o simple.o simple.c') $stdout.should_receive(:puts).once.with('gcc -c -o simple.o simple.c')
$stdout.should_receive(:puts).once.with('gcc -o simple simple.o') $stdout.should_receive(:puts).once.with('gcc -o simple simple.o')