spec/sprinkle/installers/gem_spec.rb in sprinkle-0.6.1.1 vs spec/sprinkle/installers/gem_spec.rb in sprinkle-0.6.2

- old
+ new

@@ -7,17 +7,25 @@ @version = '2.0.2' @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) + # @package = mock(Sprinkle::Package, :name => gem, :version => version) + @package = Package.new "test" do; end + @package.version version Sprinkle::Installers::Gem.new(@package, gem, options, &block) end describe 'when created' do before do @installer = create_gem @gem, @version, @options + end + + it "should return nil if no source is not configured" do + @options.delete(:source) + @installer = create_gem @gem, @version, @options + @installer.source.should == nil end it 'should accept a single package to install' do @installer.gem.should == @gem end