Sha256: 3d97e3bd15bdc0375924fb002413e58b7085e9b8aadd94a6d573861a900ae750

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

require 'test_helper'

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

  context "new windows vista system" do

    setup do
      @user_system = Sprout::System::VistaSystem.new
    end

    should "work when env_userprofile isn't found" do
      @user_system.stubs(:find_home).returns 'C:\Documents and Settings\Some System'
      File.stubs(:exists?).returns true
      assert_equal 'C:\Documents and Settings\Some System/Local Settings/Application Data', @user_system.library
    end

    context "with a valid userprofile" do

      setup do
        @user_system.stubs(:env_userprofile).returns '/somehome'
      end

      should "find library" do
        File.stubs(:exists?).returns true
        assert_equal '/somehome/Local Settings/Application Data', @user_system.library
      end

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

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

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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