Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #149 from jkutner/master

fixing ci
  • Loading branch information...
commit e4de8291d76da9b564286a2320f8ff3e4648db88 2 parents 0fe9b9b + 6c7d38c
Joe Kutner jkutner authored
Showing with 33 additions and 18 deletions.
  1. +33 −18 spec/warbler/bundler_spec.rb
51 spec/warbler/bundler_spec.rb
View
@@ -20,6 +20,15 @@ def use_config(&block)
@extra_config = block
end
+ def hide_shallow_git_clone
+ git_shallow_marker = File.join(Warbler::WARBLER_HOME, ".git/shallow")
+ tmp_marker = File.join(Warbler::WARBLER_HOME, ".git/shallow.tmp")
+ File.rename(git_shallow_marker, tmp_marker) if File.exists?(git_shallow_marker)
+ yield
+ ensure
+ File.rename(tmp_marker, git_shallow_marker) if File.exist?(tmp_marker)
+ end
+
let(:config) { drbclient.config(@extra_config) }
let(:jar) { drbclient.jar }
@@ -61,19 +70,23 @@ def use_config(&block)
end
it "works with :git entries in Gemfiles" do
- File.open("Gemfile", "w") {|f| f << "gem 'warbler', :git => '#{Warbler::WARBLER_HOME}'\n"}
- `#{RUBY_EXE} -S bundle install --local`
- jar.apply(config)
- file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/lib/warbler/version\.rb}).should_not be_empty
- file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/warbler.gemspec}).should_not be_empty
+ hide_shallow_git_clone do
+ File.open("Gemfile", "w") {|f| f << "gem 'warbler', :git => '#{Warbler::WARBLER_HOME}'\n"}
+ `#{RUBY_EXE} -S bundle install --local`
+ jar.apply(config)
+ file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/lib/warbler/version\.rb}).should_not be_empty
+ file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/warbler.gemspec}).should_not be_empty
+ end
end
it "bundles only the gemspec for :git entries that are excluded" do
- File.open("Gemfile", "w") {|f| f << "gem 'rake'\ngroup :test do\ngem 'warbler', :git => '#{Warbler::WARBLER_HOME}'\nend\n"}
- `#{RUBY_EXE} -S bundle install --local`
- jar.apply(config)
- file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/lib/warbler/version\.rb}).should be_empty
- file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/warbler.gemspec}).should_not be_empty
+ hide_shallow_git_clone do
+ File.open("Gemfile", "w") {|f| f << "gem 'rake'\ngroup :test do\ngem 'warbler', :git => '#{Warbler::WARBLER_HOME}'\nend\n"}
+ `#{RUBY_EXE} -S bundle install --local`
+ jar.apply(config)
+ file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/lib/warbler/version\.rb}).should be_empty
+ file_list(%r{WEB-INF/gems/bundler/gems/warbler[^/]*/warbler.gemspec}).should_not be_empty
+ end
end
it "does not work with :path entries in Gemfiles" do
@@ -117,14 +130,16 @@ def use_config(&block)
cleanup_temp_files
it "works with :git entries in Gemfiles" do
- File.open("Gemfile", "w") {|f| f << "gem 'warbler', :git => '#{Warbler::WARBLER_HOME}'\n"}
- `#{RUBY_EXE} -S bundle install --local`
- jar.apply(config)
- file_list(%r{^bundler/gems/warbler[^/]*/lib/warbler/version\.rb}).should_not be_empty
- file_list(%r{^bundler/gems/warbler[^/]*/warbler.gemspec}).should_not be_empty
- jar.add_init_file(config)
- contents = jar.contents('META-INF/init.rb')
- contents.should =~ /ENV\['BUNDLE_GEMFILE'\] = File.expand_path(.*, __FILE__)/
+ hide_shallow_git_clone do
+ File.open("Gemfile", "w") {|f| f << "gem 'warbler', :git => '#{Warbler::WARBLER_HOME}'\n"}
+ `#{RUBY_EXE} -S bundle install --local`
+ jar.apply(config)
+ file_list(%r{^bundler/gems/warbler[^/]*/lib/warbler/version\.rb}).should_not be_empty
+ file_list(%r{^bundler/gems/warbler[^/]*/warbler.gemspec}).should_not be_empty
+ jar.add_init_file(config)
+ contents = jar.contents('META-INF/init.rb')
+ contents.should =~ /ENV\['BUNDLE_GEMFILE'\] = File.expand_path(.*, __FILE__)/
+ end
end
it "adds BUNDLE_GEMFILE to init.rb" do
Please sign in to comment.
Something went wrong with that request. Please try again.