Sha256: 52034f90c40c91419809e072e8e8c03662b60810a51d4090ef09c4d07913bbc0

Contents?: true

Size: 873 Bytes

Versions: 4

Compression:

Stored size: 873 Bytes

Contents

require 'test_helper'

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

  context "new windows nix (cygwin/mingw) system" do

    setup do
      @sys = Sprout::System::WinNixSystem.new
      @sys.stubs(:win_home).returns 'C:\Documents and Settings\Some System'
    end

    should "find home on cygwin" do
      File.stubs(:exists?).returns false
      assert_equal '/cygdrive/c/Documents and Settings/Some System', @sys.home
    end

    should "find home on mingw" do
      File.stubs(:exists?).returns true
      assert_equal 'C:/Documents and Settings/Some System', @sys.home
    end

    should "wrap paths that have spaces with escaped quotes" do
      assert_equal "\"foo bar\"", @sys.clean_path("foo bar")
    end

    should "not modify paths that have no spaced" do
      assert_equal "foobar", @sys.clean_path("foobar")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sprout-1.0.35.pre test/unit/win_nix_system_test.rb
sprout-1.0.32.pre test/unit/win_nix_system_test.rb
sprout-1.0.31.pre test/unit/win_nix_system_test.rb
sprout-1.0.29.pre test/unit/win_nix_system_test.rb