Sha256: 095a1fd7d27badbc35fa07ac879075c431513cbefc649c3eed8ef0d026d0f5b5

Contents?: true

Size: 1.09 KB

Versions: 161

Compression:

Stored size: 1.09 KB

Contents

require File.expand_path('../helper', __FILE__)
require 'rake/loaders/makefile'

class TestRakeMakefileLoader < Rake::TestCase
  include Rake

  def test_parse
    Dir.chdir @tempdir

    open 'sample.mf', 'w' do |io|
      io << <<-'SAMPLE_MF'
# Comments
a: a1 a2 a3 a4
b: b1 b2 b3 \
   b4 b5 b6\
# Mid: Comment
b7

 a : a5 a6 a7
c: c1
d: d1 d2 \

e f : e1 f1

g\ 0: g1 g\ 2 g\ 3 g4
      SAMPLE_MF
    end

    Task.clear
    loader = Rake::MakefileLoader.new
    loader.load 'sample.mf'
    %w(a b c d).each do |t|
      assert Task.task_defined?(t), "#{t} should be a defined task"
    end
    assert_equal %w(a1 a2 a3 a4 a5 a6 a7).sort, Task['a'].prerequisites.sort
    assert_equal %w(b1 b2 b3 b4 b5 b6 b7).sort, Task['b'].prerequisites.sort
    assert_equal %w(c1).sort, Task['c'].prerequisites.sort
    assert_equal %w(d1 d2).sort, Task['d'].prerequisites.sort
    assert_equal %w(e1 f1).sort, Task['e'].prerequisites.sort
    assert_equal %w(e1 f1).sort, Task['f'].prerequisites.sort
    assert_equal ["g1", "g 2", "g 3", "g4"].sort, Task['g 0'].prerequisites.sort
    assert_equal 7, Task.tasks.size
  end
end

Version data entries

161 entries across 128 versions & 39 rubygems

Version Path
vagrant-actionio-0.0.9 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
torquebox-console-0.2.4 vendor/bundle/ruby/1.8/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
torquebox-console-0.2.4 vendor/bundle/jruby/1.9/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
torquebox-console-0.2.3 vendor/bundle/jruby/1.9/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
remq-0.0.4 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
remq-0.0.3 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
graphael-on-rails-0.5.1 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
graphael-on-rails-0.0.1 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
challah-0.9.1.beta.3 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
devise_sociable-0.1.0 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
simple-client-0.0.3 vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/test/test_rake_makefile_loader.rb
backbone-queryparams-rails-0.0.1 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
railscast-assets-0.0.2 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
railscast-assets-0.0.2 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/rake-10.0.3/test/test_rake_makefile_loader.rb