spec/vendorer_spec.rb in vendorer-0.1.1 vs spec/vendorer_spec.rb in vendorer-0.1.2
- old
+ new
@@ -57,11 +57,11 @@
end
describe '.file' do
context "with working Vendorfile" do
before do
- write 'Vendorfile', "file 'public/javascripts/jquery.min.js' => 'http://code.jquery.com/jquery-latest.min.js'"
+ write 'Vendorfile', "file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js'"
run
end
it "can download via hash syntax" do
ls('public/javascripts').should == ["jquery.min.js"]
@@ -80,12 +80,12 @@
read('public/javascripts/jquery.min.js').should include('jQuery')
end
it "can update a single file" do
write 'Vendorfile', "
- file 'public/javascripts/jquery.min.js' => 'http://code.jquery.com/jquery-latest.min.js'
- file 'public/javascripts/jquery.js' => 'http://code.jquery.com/jquery-latest.js'
+ file 'public/javascripts/jquery.min.js', 'http://code.jquery.com/jquery-latest.min.js'
+ file 'public/javascripts/jquery.js', 'http://code.jquery.com/jquery-latest.js'
"
run
read('public/javascripts/jquery.js').should include('jQuery')
read('public/javascripts/jquery.min.js').should include('jQuery')
@@ -96,33 +96,35 @@
size('public/javascripts/jquery.js').should > 300
end
end
it "fails with a nice message" do
- write 'Vendorfile', "file 'xxx.js' => 'http://NOTFOUND'"
+ write 'Vendorfile', "file 'xxx.js', 'http://NOTFOUND'"
result = run '', :raise => true
- result.should include('Downloaded empty file')
+ # different errors on travis / local
+ raise result unless result.include?("resolve host 'NOTFOUND'") or result.include?('Downloaded empty file')
end
end
describe '.folder' do
it "can download via hash syntax" do
- write 'Vendorfile', "folder 'vendor/plugins/parallel_tests' => 'https://github.com/grosser/parallel_tests.git'"
+ write 'Vendorfile', "folder 'vendor/plugins/parallel_tests', 'https://github.com/grosser/parallel_tests.git'"
run
ls('vendor/plugins').should == ["parallel_tests"]
read('vendor/plugins/parallel_tests/Gemfile').should include('parallel')
end
it "reports errors" do
- write 'Vendorfile', "folder 'vendor/plugins/parallel_tests' => 'https://blob'"
+ write 'Vendorfile', "folder 'vendor/plugins/parallel_tests', 'https://blob'"
output = run '', :raise => true
- output.should include('Connection refused')
+ # different errors on travis / local
+ raise unless output.include?('Connection refused') or output.include?('resolve host')
end
context "with a fast,local repository" do
before do
- write 'Vendorfile', "folder 'its_recursive' => '../../.git'"
+ write 'Vendorfile', "folder 'its_recursive', '../../.git'"
run
end
it "can download" do
ls('').should == ["its_recursive", "Vendorfile"]
@@ -145,11 +147,11 @@
read('its_recursive/Gemfile').should include('rake')
end
it "can update a single file" do
write 'Vendorfile', "
- folder 'its_recursive' => '../../.git'
- folder 'its_really_recursive' => '../../.git'
+ folder 'its_recursive', '../../.git'
+ folder 'its_really_recursive', '../../.git'
"
run
write('its_recursive/Gemfile', 'Foo')
write('its_really_recursive/Gemfile', 'Foo')
run 'update its_recursive'