Sha256: decf12b97440d3a0dd323f9020c0804335bed28d59d30b2e71a1ff91aaff9423

Contents?: true

Size: 875 Bytes

Versions: 4

Compression:

Stored size: 875 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe 'when building a C project' do

  include RakeBuilderHelper

  before( :all ) do
    @test_output_file = Rake::Path.expand_with_root( 'rake-c-testfile.txt', SPEC_PATH )
  end

  before( :each ) do
    Rake::Task.clear
    @project = c_task( :executable )
    @expected_generated = Rake::Path.expand_all_with_root( [ './main.o',  @project.makedepend_file, @project.target ], SPEC_PATH )
    `rm -f #{ @test_output_file }`
    `rm -f #{ @project.target }`
  end

  after( :each ) do
    Rake::Task[ 'clean' ].invoke
    `rm -f #{ @test_output_file }`
  end

  it 'builds the program with \'build\'' do
    Rake::Task[ 'build' ].invoke
    exist?( @project.target ).should be_true
  end

  it 'runs the program with \'run\'' do
    Rake::Task[ 'run' ].invoke
    exist?( @test_output_file ).should be_true
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rake-builder-0.0.14 spec/c_project_spec.rb
rake-builder-0.0.13 spec/c_project_spec.rb
rake-builder-0.0.12 spec/c_project_spec.rb
rake-builder-0.0.11 spec/c_project_spec.rb