spec/linner/asset_spec.rb in linner-0.7.3 vs spec/linner/asset_spec.rb in linner-0.8.0
- old
+ new
@@ -1,30 +1,33 @@
require "spec_helper"
describe Asset do
+ def new_asset path
+ Asset.new path
+ end
before(:each) do
- @script_asset = Asset.new("app/scripts/app.js")
- @style_asset = Asset.new("app/styles/app.css")
- @dest_asset = Asset.new("public/app.js")
+ @script_asset = new_asset "app/scripts/app.js"
+ @style_asset = new_asset "app/styles/app.css"
+ @dest_asset = new_asset "public/app.js"
end
it "should return right logical_path" do
- @script_asset.logical_path.should == "app.js"
- @style_asset.logical_path.should == "app.css"
+ expect(@script_asset.logical_path).to eq "app.js"
+ expect(@style_asset.logical_path).to eq "app.css"
end
it "should return right digest_path" do
- @dest_asset.digest_path.should == "public/app-7fa4c57f63cf67c15299ee2c79be22e0.js"
- @dest_asset.relative_digest_path.should == "/app-7fa4c57f63cf67c15299ee2c79be22e0.js"
+ expect(@dest_asset.digest_path).to eq "public/app-7fa4c57f63cf67c15299ee2c79be22e0.js"
+ expect(@dest_asset.relative_digest_path).to eq "/app-7fa4c57f63cf67c15299ee2c79be22e0.js"
end
it "should be javascript" do
- @script_asset.javascript?.should be_true
- @style_asset.stylesheet?.should be_true
+ expect(@script_asset.javascript?).to be true
+ expect(@style_asset.stylesheet?).to be true
end
it "should wrapperable" do
- @script_asset.wrappable?.should be_true
- @style_asset.wrappable?.should be_false
+ expect(@script_asset.wrappable?).to be true
+ expect(@style_asset.wrappable?).to be false
end
end