spec/sprinkle/installers/gem_spec.rb in crafterm-sprinkle-0.2.0 vs spec/sprinkle/installers/gem_spec.rb in crafterm-sprinkle-0.2.1

- 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' } + @options = { :source => 'http://gems.github.com/', :repository => '/tmp/gems', :build_flags => '--build_flag=foo' } 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) @@ -32,10 +32,14 @@ end it 'should optionally store the repository location where gems are to be installed' do @installer.repository.should == @options[:repository] end + + it 'should optionally store the build flags' do + @installer.build_flags.should == @options[:build_flags] + end end describe 'during installation' do @@ -66,9 +70,21 @@ it 'should install a specific version if defined, and with docs' do @installer.send(:install_commands).should == "gem install #{@gem} --version '#{@version}'" end + end + + describe 'with build flags' do + + before do + @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 end end