Sha256: 5707747706a6361b22d4b434c662afee045cc35bfc48036342305c8868fb122d

Contents?: true

Size: 899 Bytes

Versions: 18

Compression:

Stored size: 899 Bytes

Contents

require File.dirname(__FILE__) + '/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

18 entries across 18 versions & 1 rubygems

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