Sha256: d152afbc6dc7605aaebc84fb85f7967d95a47ca8b18bdc9d9032a22ff8c1fd27

Contents?: true

Size: 1.11 KB

Versions: 26

Compression:

Stored size: 1.11 KB

Contents

require "spec_helper"

describe Sauce::Utilities::Rake do

  describe "#create_sauce_helper" do
    context "with Capybara" do
      before :all do
        Object.stub(:const_defined?).with("Capybara").and_return true
      end

      it "includes the browser block" do
        Sauce::Utilities::Rake.sauce_helper.should include browser_block
      end

      it "includes the require for sauce" do
        Sauce::Utilities::Rake.sauce_helper.should include "require \"sauce\""
      end

      it "does not include Capybara" do
        Sauce::Utilities::Rake.sauce_helper.should include "require \"sauce/capybara\""
      end
    end

    context "without Capybara" do
      before :all do
        Object.stub(:const_defined?).with("Capybara").and_return false
      end

      it "includes the require for sauce/capybara" do
        Sauce::Utilities::Rake.sauce_helper.should_not include "require \"sauce/capybara\""
      end
    end
  end

  def browser_block
    return <<-ENDFILE
Sauce.config do |config|
  config[:browsers] = [
    ["OS", "BROWSER", "VERSION"],
    ["OS", "BROWSER", "VERSION"]
  ]
end
    ENDFILE
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
sauce-3.5.5 spec/sauce/utilities/rake_spec.rb
sauce-3.5.4 spec/sauce/utilities/rake_spec.rb
sauce-3.5.3 spec/sauce/utilities/rake_spec.rb
sauce-3.5.2 spec/sauce/utilities/rake_spec.rb
sauce-3.5.1 spec/sauce/utilities/rake_spec.rb
sauce-3.5.0 spec/sauce/utilities/rake_spec.rb
sauce-3.4.9 spec/sauce/utilities/rake_spec.rb
sauce-3.4.8 spec/sauce/utilities/rake_spec.rb
sauce-3.4.7 spec/sauce/utilities/rake_spec.rb
sauce-3.4.6 spec/sauce/utilities/rake_spec.rb
sauce-3.4.5 spec/sauce/utilities/rake_spec.rb
sauce-3.4.4 spec/sauce/utilities/rake_spec.rb
sauce-3.4.3 spec/sauce/utilities/rake_spec.rb
sauce-3.4.2 spec/sauce/utilities/rake_spec.rb
sauce-3.4.1 spec/sauce/utilities/rake_spec.rb
sauce-3.4.0 spec/sauce/utilities/rake_spec.rb
sauce-3.3.2 spec/sauce/utilities/rake_spec.rb
sauce-3.3.1 spec/sauce/utilities/rake_spec.rb
sauce-3.3.0 spec/sauce/utilities/rake_spec.rb
sauce-3.2.0 spec/sauce/utilities/rake_spec.rb