Permalink
Browse files

Add spec for row()

* Write better descriptions for other specs
  • Loading branch information...
1 parent f866be1 commit 765b0959837564080aa1803cb1a7e70132a03f83 Reda Lemeden committed Jan 29, 2013
Showing with 78 additions and 19 deletions.
  1. +2 −2 spec/neat/columns_spec.rb
  2. +1 −1 spec/neat/container_spec.rb
  3. +32 −16 spec/neat/omega_spec.rb
  4. +30 −0 spec/neat/row_spec.rb
  5. +13 −0 test/row.scss
@@ -20,7 +20,7 @@
expect('.span-columns-default').to have_rule('display: block')
end
- it "floats element left" do
+ it "sets float to left" do
expect('.span-columns-default').to have_rule('float: left')
end
@@ -44,7 +44,7 @@
expect('.span-columns-table').to have_rule('display: table-cell')
end
- it "uses padding as gutter" do
+ it "sets padding" do
expect('.span-columns-table').to have_rule('padding-right: 2.35765%')
end
@@ -11,7 +11,7 @@
expect('.container-default:after').to have_rule('clear: both')
end
- it "adds max-width" do
+ it "sets max-width" do
expect('.container-default').to have_rule('max-width: 960px')
end
end
View
@@ -7,35 +7,51 @@
ParserSupport.parse_file(identifier)
end
- it "removes right margin with no argument" do
- expect('.omega-default').to have_rule('margin-right: 0')
+ describe "when passed no arguments" do
+ it "removes right margin" do
+ expect('.omega-default').to have_rule('margin-right: 0')
+ end
end
- it "removes right padding with argument (table)" do
- expect('.omega-table').to have_rule('padding-right: 0')
+ describe "when passed display argument (table)" do
+ it "removes right padding" do
+ expect('.omega-table').to have_rule('padding-right: 0')
+ end
end
- it "removes left margin with argument (block, left)" do
- expect('.omega-block-left').to have_rule('margin-left: 0')
+ describe "when passed argument (block, left)" do
+ it "removes left margin" do
+ expect('.omega-block-left').to have_rule('margin-left: 0')
+ end
end
- it "removes left padding with argument (table, left)" do
- expect('.omega-table-left').to have_rule('padding-left: 0')
+ describe "when passed argument (table, left)" do
+ it "removes left padding" do
+ expect('.omega-table-left').to have_rule('padding-left: 0')
+ end
end
- it "removes margin right of nth-child(4n) with argument (4n)" do
- expect('.omega-nth-default:nth-child(4n)').to have_rule('margin-right: 0')
+ describe "when pased argument (4n)" do
+ it "removes right margin of nth-child(4n)" do
+ expect('.omega-nth-default:nth-child(4n)').to have_rule('margin-right: 0')
+ end
end
- it "removes padding right of nth-child(4n) with argument (4n table)" do
- expect('.omega-nth-table:nth-child(4n)').to have_rule('padding-right: 0')
+ describe "whn passed argument (4n table)" do
+ it "removes right padding of nth-child(4n)" do
+ expect('.omega-nth-table:nth-child(4n)').to have_rule('padding-right: 0')
+ end
end
- it "removes margin left of nth-child(4n) with argument (4n block, left)" do
- expect('.omega-nth-default-left:nth-child(4n)').to have_rule('margin-left: 0')
+ describe "when passed argument (4n block, left)" do
+ it "removes left margin of nth-child(4n)" do
+ expect('.omega-nth-default-left:nth-child(4n)').to have_rule('margin-left: 0')
+ end
end
- it "removes padding left of nth-child(4n) with argument (4n table, left)" do
- expect('.omega-nth-table-left:nth-child(4n)').to have_rule('padding-left: 0')
+ describe "when passed argument (4n table, left)" do
+ it "removes left padding of nth-child(4n)" do
+ expect('.omega-nth-table-left:nth-child(4n)').to have_rule('padding-left: 0')
+ end
end
end
View
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe "@include row()" do
+ let (:identifier) {"row"}
+
+ before(:all) do
+ ParserSupport.parse_file(identifier)
+ end
+
+ describe "when passed no argument" do
+ it "adds clearfix" do
+ expect('.row-default:after').to have_rule('clear: both')
+ end
+ it "sets display to block" do
+ expect('.row-default').to have_rule('display: block')
+ end
+ end
+
+ describe "when passed table display argument" do
+ it "sets display to table" do
+ expect('.row-table').to have_rule('display: table')
+ end
+ end
+
+ describe "when passed invalid display argument" do
+ it "sets display to block" do
+ expect('.row-invalid-display').to have_rule('display: block')
+ end
+ end
+end
View
@@ -0,0 +1,13 @@
+@import 'setup';
+
+.row-default {
+ @include row;
+}
+
+.row-table {
+ @include row(table);
+}
+
+.row-invalid-display {
+ @include row(invalid-argument);
+}

0 comments on commit 765b095

Please sign in to comment.