Sha256: 19611ce41aa632504c540b2acefec458476c6b351d06a2178dfe0046aad9f47a

Contents?: true

Size: 1.27 KB

Versions: 22

Compression:

Stored size: 1.27 KB

Contents

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

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

  context "new unix system" do

    setup do
      @user = Sprout::System::UnixSystem.new
      @user.stubs(:home).returns '/home/someone'
    end

    should "escape spaces in paths" do
      assert_equal 'a\ b', @user.clean_path('a b')
    end

    should "snake case application name" do
      assert_equal '.foo_bar', @user.format_application_name('Foo Bar')
    end

    should "have home" do
      assert_equal '/home/someone', @user.home
    end

    should "have library" do
      assert_equal '/home/someone', @user.library
    end

    should "format application home" do
      assert_equal '/home/someone/.sprouts', @user.application_home('Sprouts')
    end

    context "when fed an application with windows line endings" do

      setup do
        @source = File.join fixtures, 'executable', 'windows_line_endings'
        @target = File.join fixtures, 'executable', 'windows_line_endings.tmp'
        FileUtils.cp @source, @target
      end

      teardown do
        remove_file @target
      end

      should "fix windows line endings" do
        @user.expects :repair_executable
        @user.attempt_to_repair_executable @target
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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