Sha256: d9a6a475873a2e9ebebad590c0431a851a2e66c79308ab39d53aa153ef5a86f5

Contents?: true

Size: 762 Bytes

Versions: 15

Compression:

Stored size: 762 Bytes

Contents

require "test_helper"

describe Vanity::Autoconnect do
  describe ".playground_should_autoconnect?" do

    it "returns true by default" do
      autoconnect = Vanity::Autoconnect.playground_should_autoconnect?
      assert autoconnect == true
    end

    it "returns false if environment flag is set" do
      ENV['VANITY_DISABLED'] = '1'
      autoconnect = Vanity::Autoconnect.playground_should_autoconnect?
      assert autoconnect == false
      ENV['VANITY_DISABLED'] = nil
    end

    it "returns false if in assets:precompile rake task" do
      Rake.expects(:application).returns(stub(:top_level_tasks => ['assets:precompile']))
      autoconnect = Vanity::Autoconnect.playground_should_autoconnect?
      assert autoconnect == false
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vanity-2.2.0 test/autoconnect_test.rb
vanity-2.1.2 test/autoconnect_test.rb
vanity-2.1.1 test/autoconnect_test.rb
vanity-2.1.0 test/autoconnect_test.rb
vanity-2.0.1 test/autoconnect_test.rb
vanity-2.0.0 test/autoconnect_test.rb
vanity-2.0.0.beta9 test/autoconnect_test.rb
vanity-2.0.0.beta8 test/autoconnect_test.rb
vanity-2.0.0.beta7 test/autoconnect_test.rb
vanity-2.0.0.beta6 test/autoconnect_test.rb
vanity-2.0.0.beta5 test/autoconnect_test.rb
vanity-2.0.0.beta4 test/autoconnect_test.rb
vanity-2.0.0.beta3 test/autoconnect_test.rb
vanity-2.0.0.beta2 test/autoconnect_test.rb
vanity-2.0.0.beta test/autoconnect_test.rb