spec/sprinkle/installers/apt_spec.rb in crafterm-sprinkle-0.1.4 vs spec/sprinkle/installers/apt_spec.rb in crafterm-sprinkle-0.1.5
- old
+ new
@@ -4,12 +4,12 @@
before do
@package = mock(Sprinkle::Package, :name => 'package')
end
- def create_apt(debs, &block)
- Sprinkle::Installers::Apt.new(@package, debs, &block)
+ def create_apt(*debs, &block)
+ Sprinkle::Installers::Apt.new(@package, *debs, &block)
end
describe 'when created' do
it 'should accept a single package to install' do
@@ -22,10 +22,19 @@
@installer.packages.should == ['gcc', 'gdb', 'g++']
end
end
+ describe 'when created for dependencies only install' do
+
+ it 'should remove options from packages list' do
+ @installer = create_apt 'ruby', :dependencies_only => true
+ @installer.packages.should == [ 'ruby' ]
+ end
+
+ end
+
describe 'during installation' do
before do
@installer = create_apt 'ruby' do
pre :install, 'op1'
@@ -47,7 +56,19 @@
end
it 'should install a specific version if defined'
end
+
+ describe 'during dependencies only installation' do
+ before do
+ @installer = create_apt 'ruby', :dependencies_only => true
+ @install_commands = @installer.send :install_commands
+ end
+
+ it 'should invoke the apt installer with build-dep command for all specified packages' do
+ @install_commands.should =~ /apt-get -qyu build-dep ruby/
+ end
+
+ end
end