spec/assetify/pkg_spec.rb in assetify-0.1.1 vs spec/assetify/pkg_spec.rb in assetify-0.2.1

- old
+ new

@@ -1,22 +1,27 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Pkg do + + before do + `mkdir /tmp/fancy` unless Dir.exists? "/tmp/fancy" + `cp spec/fixtures/fancy.tgz /tmp/fancy` + end + it "should spawn!" do - as = Pkg.new "cool", "http://cool.js" + stub_request(:get, "http://cool.js/fancy.tgz").to_return(:body => "Hi") + as = Pkg.new "cool", "http://cool.js/fancy.tgz" as.should be_instance_of Pkg end it "should spawn!" do as = Pkg.new "cool", "http://cool.js" as.should be_instance_of Pkg end it "should get file from unpack" do - `mkdir /tmp/fancy` unless Dir.exists? "/tmp/fancy" - `cp spec/fixtures/fancy.tgz /tmp/fancy` - as = Pkg.new "fancy", "http://fancy.tgz" + as = Pkg.new "fancy", "/tmp/fancy/fancy.tgz" as.get("fancy/fancy.css").should eql("// Fancy css!\n\n#foo {\n padding: 10px;\n}\n") end end