spec/cpp_project_spec.rb in rake-builder-0.0.14 vs spec/cpp_project_spec.rb in rake-builder-0.0.15

- old
+ new

@@ -1,17 +1,17 @@ -require File.dirname(__FILE__) + '/spec_helper.rb' +load File.dirname(__FILE__) + '/spec_helper.rb' describe 'when building an executable' do include RakeBuilderHelper before( :all ) do @test_output_file = Rake::Path.expand_with_root( - 'rake-builder-testfile.txt', SPEC_PATH ) + 'rake-builder-testfile.txt', RakeBuilderHelper::SPEC_PATH ) @expected_target = Rake::Path.expand_with_root( RakeBuilderHelper::TARGET[ :executable ], - SPEC_PATH ) + RakeBuilderHelper::SPEC_PATH ) end before( :each ) do Rake::Task.clear @project = cpp_task( :executable ) @@ -75,12 +75,12 @@ after( :each ) do Rake::Task[ 'my_namespace:clean' ].invoke end it 'creates the correct tasks' do - expected_tasks = expected_tasks( [ @project.target ], 'my_namespace' ) - missing_tasks = expected_tasks - task_names + expected = expected_tasks( scoped_tasks( [ @project.target ], 'my_namespace' ), 'my_namespace' ) + missing_tasks = expected - task_names missing_tasks.should == [] end end @@ -117,10 +117,12 @@ include RakeBuilderHelper before( :each ) do Rake::Task.clear - @project = cpp_task( :shared_library ) + @project = cpp_task( :shared_library ) do |builder| + builder.compilation_options += ['-fPIC'] + end `rm -f #{ @project.target }` end after( :each ) do Rake::Task[ 'clean' ].invoke