Sha256: ddd9f17c99ebc08371773b2c77d215aa04e1ba03538a2838bbf27c73658bd6c3

Contents?: true

Size: 1.77 KB

Versions: 16

Compression:

Stored size: 1.77 KB

Contents

require "spec_helper"

describe "position" do
  before(:all) do
    ParserSupport.parse_file("library/position")
  end

  context "called with one size" do
    it "applies same width to all sides" do
      ruleset = "position: fixed; " +
                "top: 1em; " +
                "right: 1em; " +
                "bottom: 1em; " +
                "left: 1em;"

      expect(".position-all").to have_ruleset(ruleset)
    end
  end

  context "called with two sizes" do
    it "applies to alternating sides" do
      ruleset = "position: absolute; " +
                "top: 2px; " +
                "right: 3px; " +
                "bottom: 2px; " +
                "left: 3px;"

      expect(".position-alternate").to have_ruleset(ruleset)
    end
  end

  context "called with three sizes" do
    it "applies second width to left and right" do
      ruleset = "position: relative; " +
                "top: 4px; " +
                "right: 5px; " +
                "bottom: 6px; " +
                "left: 5px;"

      expect(".position-implied-left").to have_ruleset(ruleset)
    end
  end

  context "called with four sizes" do
    it "applies different widths to all sides" do
      ruleset = "position: fixed; " +
                "top: 7px; " +
                "right: 8px; " +
                "bottom: 9px; " +
                "left: 10px;"

      expect(".position-explicit").to have_ruleset(ruleset)
    end
  end

  context "called with null values" do
    it "writes rules for others" do
      ruleset = "position: static; " +
                "top: 11px; " +
                "left: 13px;"
      bad_rule = "position-bottom: null; position-right: null;"

      expect(".position-false-third").to have_ruleset(ruleset)
      expect(".position-false-third").to_not have_rule(bad_rule)
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
bourbon-7.3.0 spec/bourbon/library/position_spec.rb
bourbon-7.2.0 spec/bourbon/library/position_spec.rb
bourbon-7.1.0 spec/bourbon/library/position_spec.rb
bourbon-7.0.0 spec/bourbon/library/position_spec.rb
bourbon-6.0.0 spec/bourbon/library/position_spec.rb
bourbon-5.1.0 spec/bourbon/library/position_spec.rb
bourbon-5.0.1 spec/bourbon/library/position_spec.rb
bourbon-5.0.0 spec/bourbon/library/position_spec.rb
bourbon-5.0.0.beta.8 spec/bourbon/library/position_spec.rb
bourbon-5.0.0.beta.7 spec/bourbon/library/position_spec.rb
doggystyle-0.1.0 spec/doggystyle/library/position_spec.rb
bourbon-5.0.0.beta.6 spec/bourbon/library/position_spec.rb
bourbon-5.0.0.beta.5 spec/bourbon/library/position_spec.rb
bourbon-5.0.0.beta.4 spec/bourbon/library/position_spec.rb
bourbon-5.0.0.beta.3 spec/bourbon/library/position_spec.rb
bourbon-5.0.0.beta.2 spec/bourbon/library/position_spec.rb