spec/sprinkle/installers/source_spec.rb in sprinkle-0.7.4 vs spec/sprinkle/installers/source_spec.rb in sprinkle-0.7.5
- old
+ new
@@ -33,20 +33,20 @@
@installer.defaults(@deployment)
end
def create_source(source, version = nil, &block)
- @package = mock(Sprinkle::Package, :name => 'package', :version => version,
+ @package = double(Sprinkle::Package, :name => 'package', :version => version,
:installer_methods => [])
Sprinkle::Installers::Source.new(@package, source, &block)
end
describe 'when created' do
it 'should accept a source archive name to install' do
- @installer.source.should == @source
+ @installer.source.should eq @source
end
end
describe 'before installation' do
@@ -75,51 +75,50 @@
end
describe 'customized configuration' do
it 'should support specification of "enable" options' do
- @installer.enable.should == %w( headers ssl deflate so )
+ @installer.enable.should eq %w( headers ssl deflate so )
end
it 'should support specification of "disable" options' do
- @installer.disable.should == %w( cache proxy rewrite )
+ @installer.disable.should eq %w( cache proxy rewrite )
end
it 'should support specification of "with" options' do
- @installer.with.should == %w( debug extras )
+ @installer.with.should eq %w( debug extras )
end
it 'should support specification of "without" options' do
- @installer.without.should == %w( fancyisms pandas )
+ @installer.without.should eq %w( fancyisms pandas )
end
it 'should support specification of "option" options' do
- @installer.option.should == %w( foo bar baz )
+ @installer.option.should eq %w( foo bar baz )
end
it 'should support customized build area' do
- @installer.prefix.should == '/usr/local'
+ @installer.prefix.should eq '/usr/local'
end
it 'should support customized source area' do
- @installer.archives.should == '/usr/local/archives'
+ @installer.archives.should eq '/usr/local/archives'
end
it 'should support customized install area' do
- @installer.builds.should == '/usr/local/builds'
+ @installer.builds.should eq '/usr/local/builds'
end
end
describe 'during gnu source archive style installation' do
it 'should prepare the build, installation and source archives area' do
@installer.should_receive(:prepare).and_return []
end
it "should prepare the build, installation and source archives area with correct paths" do
- @installer.send(:prepare).should ==
- [
+ @installer.send(:prepare).should eq [
'mkdir -p /usr/local',
'mkdir -p /usr/local/builds',
'mkdir -p /usr/local/archives'
]
end
@@ -127,23 +126,21 @@
it 'should download the source archive' do
@installer.should_receive(:download).and_return []
end
it 'should download the source archive to the correct path' do
- @installer.send(:download).should ==
- [
+ @installer.send(:download).should eq [
"wget -cq -O '/usr/local/archives/#{@source.split('/').last}' #{@source}"
]
end
it 'should extract the source archive' do
@installer.should_receive(:extract).and_return []
end
it 'should extract the source to the correct path' do
- @installer.send(:extract).should ==
- [
+ @installer.send(:extract).should eq [
"bash -c 'cd /usr/local/builds && tar xzf /usr/local/archives/ruby-1.8.6-p111.tar.gz'"
]
end
it 'should configure the source' do
@@ -175,23 +172,21 @@
it 'should build the source' do
@installer.should_receive(:build).and_return []
end
it 'should build the source in the correct build path' do
- @installer.send(:build).should ==
- [
+ @installer.send(:build).should eq [
"bash -c 'cd /usr/local/builds/#{@filename} && make > #{@package.name}-build.log 2>&1'"
]
end
it 'should install the source' do
@installer.should_receive(:install).and_return []
end
it 'should install the source from the correct build path' do
- @installer.send(:install).should ==
- [
+ @installer.send(:install).should eq [
"bash -c 'cd /usr/local/builds/#{@filename} && make install > #{@package.name}-install.log 2>&1'"
]
end
describe 'with a custom archive definition' do
@@ -235,13 +230,13 @@
@installer.defaults(@deployment)
end
it 'should store the custom commands' do
- @installer.options[:configure_command].should == './custom-configure'
- @installer.options[:build_command].should == 'custom-make'
- @installer.options[:install_command].should == 'custom-make install'
+ @installer.options[:configure_command].should eq './custom-configure'
+ @installer.options[:build_command].should eq 'custom-make'
+ @installer.options[:install_command].should eq 'custom-make install'
end
it 'should use the custom commands' do
@installer.send(:configure_commands).first.should =~ /\.\/custom-configure/
@installer.send(:build_commands).first.should =~ /custom-make/
@@ -259,11 +254,11 @@
@installer.defaults(@deployment)
end
it 'should store the custom install commands' do
- @installer.options[:custom_install].first.should == 'ruby setup.rb'
+ @installer.options[:custom_install].first.should eq 'ruby setup.rb'
end
it 'should identify as having a custom install command' do
@installer.should be_custom_install
end
@@ -293,11 +288,11 @@
it 'should install the source from the custom dir path' do
@installer.send(:custom_install_commands).first.should =~ /test/
end
it 'should store the custom build dir path' do
- @installer.options[:custom_dir].should == 'test'
+ @installer.options[:custom_dir].should eq 'test'
end
end
end
@@ -422,21 +417,21 @@
@installer.source = 'blah.zip'
@extraction = 'unzip -o'
end
after do
- @installer.send(:extract_command).should == @extraction
+ @installer.send(:extract_command).should eq @extraction
end
end
describe 'base dir calculation' do
%w( tar tar.gz tgz tar.bz2 tb2 zip ).each do |archive|
it "should recognize #{archive} style archives" do
@installer.source = "blah.#{archive}"
- @installer.send(:base_dir).should == 'blah'
+ @installer.send(:base_dir).should eq 'blah'
end
end
# def base_dir #:nodoc: