Skip to content

Commit

Permalink
Added test for sprite-replace-text. I've never programmed in ruby b…
Browse files Browse the repository at this point in the history
…efore, so it probably doesn't actually work! Please fix if you know how :)
  • Loading branch information
ultimatedelman committed Sep 26, 2011
1 parent 7f89d66 commit b9bd7c4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/integrations/sprites_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -604,4 +604,36 @@ def render(scss)
CSS
end

it "should replace text with images and dimensions using sprites"
css = render <<-SCSS
@import "imgs/*.png";
$sprite: sprite-map("imgs/*.png");
.myImg {
@include sprite-replace-text($sprite, myImg);
}
.yourImg {
@include sprite-replace-text($sprite, yourImg);
}
SCSS
assert_correct css, <<-CSS
.myImg {
text-indent: -119988px;
overflow: hidden;
text-align: left;
background: url('imgs/imgs-s3020e82f52.png') 0 0 no-repeat;
display: block;
width: 26px; //whatever the dimensions are
height: 26px;
}
.yourImg {
text-indent: -119988px;
overflow: hidden;
text-align: left;
background: url('imgs/imgs-s3020e82f52.png') 0 -26px no-repeat; //shifted
display: block;
width: 26px; //whatever the dimensions are
height: 26px;
}
CSS
end
end

0 comments on commit b9bd7c4

Please sign in to comment.