test/test_hoe_travis.rb in hoe-travis-1.0 vs test/test_hoe_travis.rb in hoe-travis-1.1

- old
+ new

@@ -4,10 +4,12 @@ require 'fileutils' class TestHoeTravis < MiniTest::Unit::TestCase def setup + Rake.application.clear + @hoe = Hoe.spec "blah" do developer 'author', 'email@example' developer 'silent', '' self.readme_file = 'README.rdoc' @@ -22,14 +24,56 @@ def teardown ENV['EDITOR'] = @editor ENV['HOME'] = @home end + def test_define_travis_tasks + @hoe.define_travis_tasks + + travis = Rake::Task['travis'] + assert_equal %w[test], travis.prerequisites + + after = Rake::Task['travis:after'] + assert_equal %w[travis:fake_config check_manifest], after.prerequisites + + before = Rake::Task['travis:before'] + assert_equal %w[install_plugins check_extra_deps], before.prerequisites + + check = Rake::Task['travis:check'] + assert_empty check.prerequisites + + disable = Rake::Task['travis:disable'] + assert_empty disable.prerequisites + + edit = Rake::Task['travis:edit'] + assert_empty edit.prerequisites + + enable = Rake::Task['travis:enable'] + assert_empty enable.prerequisites + + force = Rake::Task['travis:force'] + assert_empty force.prerequisites + + fake_config = Rake::Task['travis:fake_config'] + assert_empty fake_config.prerequisites + + generate = Rake::Task['travis:generate'] + assert_empty generate.prerequisites + end + + def test_travis_after_script + expected = [ + 'rake travis:after -t', + ] + + assert_equal expected, @hoe.travis_after_script + end + def test_travis_before_script expected = [ 'gem install hoe-travis --no-rdoc --no-ri', - 'rake travis:before', + 'rake travis:before -t', ] assert_equal expected, @hoe.travis_before_script end @@ -176,12 +220,14 @@ Dir.chdir path do travis_yml = YAML.load @hoe.travis_yml_generate expected = YAML.load <<-TRAVIS_YML --- +after_script: +- rake travis:after -t before_script: - gem install hoe-travis --no-rdoc --no-ri -- rake travis:before +- rake travis:before -t language: ruby notifications: email: - email@example rvm: