Sha256: 8c66d2877a64c93e94223cecae38a7a862b8b4928e7eb74bac6703122563a001

Contents?: true

Size: 1.17 KB

Versions: 22

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/test_helper'

class PathParamTest < Test::Unit::TestCase
  include SproutTestCase

  context "a new PathParam" do

    setup do
      @path1 = File.join(fixtures, 'executable', 'paths', 'folder1')

      @param = Sprout::Executable::Path.new
      @param.belongs_to = FakeExecutableTask.new
      @param.name = 'path'
    end

    should "accept a collection of paths" do
      @param.value = @path1

      assert_equal "-path=#{@path1}", @param.to_shell
      # All child files have been added as prerequisites:
      assert_equal 3, @param.belongs_to.prerequisites.size
    end

    should "accept a custom file expression" do
      @param.file_expression = "file2"
      @param.value = @path1
      assert_equal "-path=#{@path1}", @param.to_shell
      # All child files have been added as prerequisites:
      assert_equal 1, @param.belongs_to.prerequisites.size
    end

    should "accept hidden_name parameter" do
      @param.hidden_name = true
      @param.value = @path1
      assert_equal @path1, @param.to_shell
      # All child files have been added as prerequisites:
      assert_equal 3, @param.belongs_to.prerequisites.size
    end

  end
end


Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
sprout-1.0.26.pre test/unit/path_param_test.rb
sprout-1.0.25.pre test/unit/path_param_test.rb
sprout-1.0.24.pre test/unit/path_param_test.rb
sprout-1.0.23.pre test/unit/path_param_test.rb
sprout-1.0.22.pre test/unit/path_param_test.rb
sprout-1.0.20.pre test/unit/path_param_test.rb
sprout-1.0.19.pre test/unit/path_param_test.rb
sprout-1.0.18.pre test/unit/path_param_test.rb
sprout-1.0.17.pre test/unit/path_param_test.rb
sprout-1.0.16.pre test/unit/path_param_test.rb
sprout-1.0.15.pre test/unit/path_param_test.rb
sprout-1.0.14.pre test/unit/path_param_test.rb
sprout-1.0.13.pre test/unit/path_param_test.rb
sprout-1.0.11.pre test/unit/path_param_test.rb
sprout-1.0.9.pre test/unit/path_param_test.rb
sprout-1.0.8.pre test/unit/path_param_test.rb
sprout-1.0.5.pre test/unit/path_param_test.rb
sprout-1.0.4.pre test/unit/path_param_test.rb
sprout-1.0.3.pre test/unit/path_param_test.rb
sprout-1.0.2.pre test/unit/path_param_test.rb