sprite base spec selector methods
This commit is contained in:
parent
03b0ee2660
commit
f78744171d
@ -7,7 +7,7 @@ GIT
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
compass (0.11.beta.3.a5e2795)
|
||||
compass (0.11.beta.3.03b0ee2)
|
||||
chunky_png (~> 1.1.0)
|
||||
sass (>= 3.1.0.alpha.249)
|
||||
|
||||
|
@ -55,6 +55,30 @@ module Compass
|
||||
File.mtime(file)
|
||||
end
|
||||
|
||||
def hover?
|
||||
base.has_hover?(name)
|
||||
end
|
||||
|
||||
def hover
|
||||
base.image_for("#{name}_hover")
|
||||
end
|
||||
|
||||
def target?
|
||||
base.has_target?(name)
|
||||
end
|
||||
|
||||
def target
|
||||
base.image_for("#{name}_target")
|
||||
end
|
||||
|
||||
def active?
|
||||
base.has_active?(name)
|
||||
end
|
||||
|
||||
def active
|
||||
base.image_for("#{name}_active")
|
||||
end
|
||||
|
||||
private
|
||||
def dimensions
|
||||
@dimensions ||= Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(file).size
|
||||
|
@ -38,6 +38,11 @@ describe Compass::SassExtensions::Sprites::Base do
|
||||
it "should have a #{selector}" do
|
||||
subject.send(:"has_#{selector}?", 'ten-by-ten').should be_true
|
||||
end
|
||||
|
||||
it "should return #{selector} image class" do
|
||||
subject.image_for('ten-by-ten').send(:"#{selector}").name.should == "ten-by-ten_#{selector}"
|
||||
end
|
||||
|
||||
end
|
||||
context "#generate" do
|
||||
before { @base.generate }
|
||||
|
Loading…
Reference in New Issue
Block a user