Sha256: 6d082a14869a66dcb3b6982914525171213192def2f92db2573339e6506da129

Contents?: true

Size: 1.11 KB

Versions: 22

Compression:

Stored size: 1.11 KB

Contents

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

22 entries across 22 versions & 1 rubygems

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