spec/neat/shift_spec.rb in neat-1.2.1 vs spec/neat/shift_spec.rb in neat-1.3.0
- old
+ new
@@ -1,28 +1,26 @@
require 'spec_helper'
describe "@include shift()" do
- let (:identifier) {"shift"}
-
before(:all) do
- ParserSupport.parse_file(identifier)
+ ParserSupport.parse_file("shift")
end
context "with no argument" do
- it "shifts element one column to the left" do
+ it "shifts element one column in the default direction" do
expect('.shift-default').to have_rule('margin-left: 8.5298%')
end
end
- context "with argument '2'" do
- it "shifts element 2 column to the left" do
+ context "with argument (2)" do
+ it "shifts element 2 columns in the default direction" do
expect('.shift-positive').to have_rule('margin-left: 17.05961%')
end
end
- context "with argument '-3'" do
- it "shifts element 3 column to the right" do
+ context "with argument (-3)" do
+ it "shifts element 3 columns in the opposite direction" do
expect('.shift-negative').to have_rule('margin-left: -25.58941%')
end
end
context "when nested" do
@@ -30,8 +28,14 @@
expect('.shifted-parent .shifted-child').to have_rule('margin-left: 34.94305%')
end
it "resets nesting context" do
expect('.post-nested-shift').to have_rule('margin-left: 17.05961%')
+ end
+ end
+
+ context "when layout direction changes" do
+ it "shifts element in the corresponding direction" do
+ expect('section .shift-negative').to have_rule('margin-right: -25.58941%')
end
end
end