Sha256: c5843b3cf2d7cecfa5151acfc63e61f9954298eebdd16d39dce0e60ff206efa5
Contents?: true
Size: 1.84 KB
Versions: 5
Compression:
Stored size: 1.84 KB
Contents
load File.dirname(__FILE__) + '/spec_helper.rb' require 'json' describe 'when handling generated files' do include RakeBuilderHelper before( :each ) do Rake::Task.clear @project = cpp_task( :executable ) @expected_generated = Rake::Path.expand_all_with_root( [ 'main.o', 'rake-builder-testfile.txt', @project.makedepend_file, @project.target ], RakeBuilderHelper::SPEC_PATH ) end after( :each ) do Rake::Task[ 'clean' ].execute end it 'lists generated files, with a method' do @project.generated_files.should =~ @expected_generated end it 'lists generated files, via the task' do stdout, _ = capturing_output do Rake::Task[ 'generated_files' ].invoke end JSON.load(stdout). should =~ @expected_generated end it 'removes generated files with \'clean\'' do Rake::Task[ 'run' ].invoke @expected_generated.each do |f| exist?( f ).should be_true end Rake::Task[ 'clean' ].invoke @expected_generated.each do |f| exist?( f ).should be_false end end end describe 'when adding generated files' do include RakeBuilderHelper before( :each ) do @file = 'foobar.txt' @file_with_path = Rake::Path.expand_with_root( @file, RakeBuilderHelper::SPEC_PATH ) end it 'includes added files' do @project = cpp_task( :executable ) do |app| app.generated_files << @file_with_path end @project.generated_files.include?( @file_with_path ).should be_true end it 'expands the paths of added files' do @project = cpp_task( :executable ) do |app| app.generated_files << @file end @project.generated_files.include?( @file_with_path ).should be_true end end
Version data entries
5 entries across 5 versions & 1 rubygems