spec/sprinkle/installers/gem_spec.rb in sprinkle-0.2.2 vs spec/sprinkle/installers/gem_spec.rb in sprinkle-0.2.3
- old
+ new
@@ -3,11 +3,11 @@
describe Sprinkle::Installers::Gem do
before do
@gem = 'rails'
@version = '2.0.2'
- @options = { :source => 'http://gems.github.com/', :repository => '/tmp/gems', :build_flags => '--build_flag=foo' }
+ @options = { :source => 'http://gems.github.com/', :repository => '/tmp/gems', :build_flags => '--build_flag=foo', :http_proxy => 'http://proxy:8080' }
end
def create_gem(gem, version = nil, options = {}, &block)
@package = mock(Sprinkle::Package, :name => gem, :version => version, :source => nil, :repository => nil)
Sprinkle::Installers::Gem.new(@package, gem, options, &block)
@@ -37,10 +37,14 @@
it 'should optionally store the build flags' do
@installer.build_flags.should == @options[:build_flags]
end
+ it 'should optionally store the http proxy' do
+ @installer.http_proxy.should == @options[:http_proxy]
+ end
+
end
describe 'during installation' do
describe 'without a version' do
@@ -80,9 +84,21 @@
@installer = create_gem @gem, nil, :build_flags => '--option=foo'
end
it 'should install with defined build flags' do
@installer.send(:install_commands).should == "gem install #{@gem} --no-rdoc --no-ri -- --option=foo"
+ end
+
+ end
+
+ describe 'with http proxy' do
+
+ before do
+ @installer = create_gem @gem, nil, :http_proxy => 'http://proxy:8080'
+ end
+
+ it 'should install with defined build flags' do
+ @installer.send(:install_commands).should == "gem install #{@gem} --no-rdoc --no-ri --http-proxy http://proxy:8080"
end
end
end