Skip to content

Commit

Permalink
added spec for sprite mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenburger authored and chriseppstein committed Nov 28, 2010
1 parent c17fe44 commit 6d0315a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/sprites_spec.rb
Expand Up @@ -12,6 +12,8 @@
def render(scss)
scss = %Q(@import "compass"; #{scss})
options = Compass.sass_engine_options
options[:line_comments] = false
options[:style] = :expanded
options[:syntax] = :scss
options[:load_paths] << Compass::Sprites.new
css = Sass::Engine.new(scss, options).render
Expand Down Expand Up @@ -57,4 +59,34 @@ def render(scss)
width: 20px; }
CSS
end

it "should provide sprite mixin" do
css = render <<-SCSS
@import "squares/*.png";
.cubicle {
@include squares-sprite("10x10");
}
.large-cube {
@include squares-sprite("20x20", true);
}
SCSS
css.should == <<-CSS
.squares-sprite, .cubicle, .large-cube {
background: url('/squares.png') no-repeat; }
.cubicle {
background-position: 0 0;
}
.large-cube {
background-position: 0 -10px;
height: 20px;
width: 20px;
}
CSS

end

end

0 comments on commit 6d0315a

Please sign in to comment.