Sha256: 02aa9bfde17068e9a3b90e9052aa1db32667c69828959fdbcb2d4b72e82c35fd

Contents?: true

Size: 1.7 KB

Versions: 17

Compression:

Stored size: 1.7 KB

Contents

require "spec_helper"

describe "retina-image" do
  before(:all) do
    ParserSupport.parse_file("addons/retina-image")
  end

  context "called with defaults" do
    it "applies defaults" do
      ruleset = 'background-image: url("retina-default.png");; ' +
                'background-image: url("retina-default_2x.png"); ' +
                'background-size: "320px 480px";'

      expect(".retina-default").to have_ruleset(ruleset)
    end
  end

  context "called with extension" do
    it "applies file extension" do
      ruleset = 'background-image: url("retina-extension.jpg");; ' +
                'background-image: url("retina-extension_2x.jpg"); ' +
                'background-size: "20px 40px";'

      expect(".retina-extension").to have_ruleset(ruleset)
    end
  end

  context "called with custom retina filename" do
    it "applies filename" do
      ruleset = 'background-image: url("default.png");; ' +
                'background-image: url("custom.png"); ' +
                'background-size: "10px 5px";'

      expect(".retina-custom-name").to have_ruleset(ruleset)
    end
  end

  context "called with custom retina suffix" do
    it "applies suffix" do
      ruleset = 'background-image: url("default.png");; ' +
                'background-image: url("default@2x.png"); ' +
                'background-size: "3em 2em";'

      expect(".retina-custom-suffix").to have_ruleset(ruleset)
    end
  end

  context "called with no pipeline" do
    it "applies suffix" do
      ruleset = 'background-image: url("default.jpg");; ' +
                'background-image: url("default.jpg"); ' +
                'background-size: "100px 20px";'

      expect(".retina-pipeline").to have_ruleset(ruleset)
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
bourbon-4.3.4 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.3.3 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.3.2 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.3.1 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.3.0 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.2.7 spec/bourbon/addons/retina_image_spec.rb
styler-sass-0.1.8.alpha spec/bourbon/addons/retina_image_spec.rb
styler-sass-0.1.7 spec/bourbon/addons/retina_image_spec.rb
styler-sass-0.1.7.alpha spec/bourbon/addons/retina_image_spec.rb
styler-sass-0.1.5.alpha spec/bourbon/addons/retina_image_spec.rb
bourbon-4.2.6 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.2.5 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.2.4 spec/bourbon/addons/retina_image_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/bourbon-4.2.3/spec/bourbon/addons/retina_image_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/bourbon-4.2.3/spec/bourbon/addons/retina_image_spec.rb
bourbon-4.2.3 spec/bourbon/addons/retina_image_spec.rb
bourbon-4.2.2 spec/bourbon/addons/retina_image_spec.rb