Sha256: 0dcc80e181958fcd7f55c0d0d8dc4e873f1f7083c0ff29edaec96bfa7df9cbea

Contents?: true

Size: 1.7 KB

Versions: 8

Compression:

Stored size: 1.7 KB

Contents

require "spec_helper"

describe "grid-shift" do
  before(:all) do
    ParserSupport.parse_file("mixins/grid-shift")
  end

  context "called with default settings" do
    it "adds relative positioning without moving the object" do
      rule = "left: auto; position: relative;"

      expect(".grid-shift-default").to have_ruleset(rule)
    end

    it "moves the object one column to the right" do
      rule = "left: calc(8.33333% - 21.66667px + 20px); position: relative;"

      expect(".grid-shift-1-default").to have_ruleset(rule)
    end

    it "moves the object six columns to the right" do
      rule = "left: calc(50% - 30px + 20px); position: relative;"

      expect(".grid-shift-6-default").to have_ruleset(rule)
    end

    it "moves the object six columns to the left" do
      rule = "left: calc(-50% - 10px + 20px); position: relative;"

      expect(".grid-shift-neg-6-default").to have_ruleset(rule)
    end
  end

  context "called with custom settings" do
    it "adds relative positioning without moving the object" do
      rule = "left: auto; position: relative;"

      expect(".grid-shift-0-six").to have_ruleset(rule)
    end

    it "moves the object one column to the right" do
      rule = "left: calc(16.66667% - 2.33333rem + 2rem); position: relative;"

      expect(".grid-shift-1-six").to have_ruleset(rule)
    end

    it "moves the object three columns to the right" do
      rule = "left: calc(50% - 3rem + 2rem); position: relative;"

      expect(".grid-shift-3-six").to have_ruleset(rule)
    end

    it "moves the object three columns to the left" do
      rule = "left: calc(-50% - 1rem + 2rem); position: relative;"

      expect(".grid-shift-neg-3-six").to have_ruleset(rule)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
neat-4.0.0 spec/neat/mixins/grid_shift_spec.rb
neat-3.0.1 spec/neat/mixins/grid_shift_spec.rb
neat-3.0.0 spec/neat/mixins/grid_shift_spec.rb
neat-2.1.0 spec/neat/mixins/grid_shift_spec.rb
neat-2.0.0 spec/neat/mixins/grid_shift_spec.rb
neat-2.0.0.beta.2 spec/neat/mixins/grid_shift_spec.rb
neat-2.0.0.beta.1 spec/neat/mixins/grid_shift_spec.rb
neat-2.0.0.alpha.1 spec/neat/mixins/grid_shift_spec.rb