Sha256: 7c0d646d0aff6eb31af4aee13fbfd4fe614c150216a3f417cc50dd31c318f5d3

Contents?: true

Size: 904 Bytes

Versions: 8

Compression:

Stored size: 904 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
require 'rbbt/util/rake'

class TestRake < Test::Unit::TestCase
  def test_run
    rakefile=<<-EOF
require 'rbbt/util/rake'

file "foo" do |t|
  Open.write(t.name, 'bar')
end
    EOF

    TmpFile.with_file(rakefile) do |f|
      RakeHelper.run f, :foo

      assert File.exists? "foo"
      FileUtils.rm "foo"
    end
  end

  def test_run_default
    rakefile=<<-EOF
require 'rbbt/util/rake'

file "foo" do |t|
  Open.write(t.name, 'bar')
end
    EOF

    TmpFile.with_file(rakefile) do |f|
      RakeHelper.run f

      assert File.exists? "foo"
      FileUtils.rm "foo"
    end
  end


  def test_files
    rakefile=<<-EOF
require 'rbbt/util/rake'

file "foo" do |t|
  Open.write(t.name, 'bar')
end
    EOF

    TmpFile.with_file(rakefile) do |f|
      assert RakeHelper.files(f).include? "foo"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rbbt-util-3.2.1 test/rbbt/util/test_rake.rb
rbbt-util-3.2.0 test/rbbt/util/test_rake.rb
rbbt-util-3.1.0 test/rbbt/util/test_rake.rb
rbbt-util-3.0.3 test/rbbt/util/test_rake.rb
rbbt-util-3.0.2 test/rbbt/util/test_rake.rb
rbbt-util-2.1.0 test/rbbt/util/test_rake.rb
rbbt-util-2.0.1 test/rbbt/util/test_rake.rb
rbbt-util-1.2.1 test/rbbt/util/test_rake.rb