From 37d324173a2073e53d4d70ce30af06356a8903f2 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 26 Jun 2013 22:10:17 -0400 Subject: [PATCH] test short echo mode --- spec/build_tests_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index 1cea453..1c8836a 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -33,6 +33,17 @@ describe Rscons do 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 $stdout.should_receive(:puts).once.with('gcc -c -o simple.o simple.c') $stdout.should_receive(:puts).once.with('gcc -o simple simple.o')