Commit 60cb693f authored by Samuel Giddins's avatar Samuel Giddins

Update specs for removal of deprecations

parent 9242a26c
...@@ -44,7 +44,7 @@ module Pod ...@@ -44,7 +44,7 @@ module Pod
# #
def initialize(name, plugin_name, block) def initialize(name, plugin_name, block)
raise ArgumentError, 'Missing name' unless name raise ArgumentError, 'Missing name' unless name
raise ArgumentError, 'Missing plugin_name' unless name raise ArgumentError, 'Missing plugin_name' unless plugin_name
raise ArgumentError, 'Missing block' unless block raise ArgumentError, 'Missing block' unless block
@name = name @name = name
......
...@@ -53,25 +53,5 @@ module Pod ...@@ -53,25 +53,5 @@ module Pod
`git log --pretty=oneline`.strip.split("\n").size.should > 1 `git log --pretty=oneline`.strip.split("\n").size.should > 1
end end
end end
before do
FileUtils.rm_rf(test_repo_path)
set_up_old_test_repo
config.repos_dir = SpecHelper.temporary_directory + 'cocoapods/repos'
Command::Setup.any_instance.stubs(:old_master_repo_dir).returns(SpecHelper.temporary_directory + 'cocoapods/master')
end
it 'migrates repos from the old directory structure to the new one' do
source = SpecHelper.temporary_directory + 'cocoapods/master'
target = config.repos_dir + 'master'
source.should.exist?
target.should.not.exist?
run_command('setup')
source.should.not.exist?
target.should.exist?
end
end end
end end
...@@ -19,26 +19,26 @@ module Pod ...@@ -19,26 +19,26 @@ module Pod
it 'raises if no name is given' do it 'raises if no name is given' do
should.raise ArgumentError do should.raise ArgumentError do
@hooks_manager.register(nil) {} @hooks_manager.register('name', nil) {}
end end
end end
it 'raises if no block is given' do it 'raises if no block is given' do
should.raise ArgumentError do should.raise ArgumentError do
@hooks_manager.register(:post_install) @hooks_manager.register('name', :post_install)
end end
end end
it 'warns if no plugin name is given' do it 'raises if no plugin name is given' do
@hooks_manager.register(:post_install) {} should.raise ArgumentError do
UI.warnings.should.match /hooks without.*deprecated/ @hooks_manager.register(nil, :post_install) {}
UI.warnings.should.match /#{__FILE__}/ end
end end
end end
describe 'run' do describe 'run' do
it 'invokes the hooks' do it 'invokes the hooks' do
@hooks_manager.register(:post_install) do |_options| @hooks_manager.register('plugin', :post_install) do |_options|
true.should.be.true true.should.be.true
end end
@hooks_manager.run(:post_install, Object.new) @hooks_manager.run(:post_install, Object.new)
...@@ -51,7 +51,7 @@ module Pod ...@@ -51,7 +51,7 @@ module Pod
end end
it 'handles the case that no listeners have registered for a name' do it 'handles the case that no listeners have registered for a name' do
@hooks_manager.register(:post_install) do |_options| @hooks_manager.register('plugin', :post_install) do |_options|
true.should.be.true true.should.be.true
end end
should.not.raise do should.not.raise do
...@@ -106,7 +106,7 @@ module Pod ...@@ -106,7 +106,7 @@ module Pod
it 'prints a message in verbose mode when any hooks are run' do it 'prints a message in verbose mode when any hooks are run' do
config.verbose = true config.verbose = true
@hooks_manager.register(:post_install) {} @hooks_manager.register('plugin', :post_install) {}
@hooks_manager.run(:post_install, Object.new) @hooks_manager.run(:post_install, Object.new)
UI.output.should.match /- Running post install hooks/ UI.output.should.match /- Running post install hooks/
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment