Commit 7e2dbedd authored by Eloy Duran's avatar Eloy Duran

No more need to reset global state in the specs.

parent b09aaebd
...@@ -54,8 +54,6 @@ describe "Pod::Command" do ...@@ -54,8 +54,6 @@ describe "Pod::Command" do
end end
before do before do
Pod::Source.reset!
Pod::Spec::Set.reset!
config.repos_dir = fixture('spec-repos') config.repos_dir = fixture('spec-repos')
end end
......
...@@ -32,8 +32,6 @@ else ...@@ -32,8 +32,6 @@ else
extend SpecHelper::TemporaryDirectory extend SpecHelper::TemporaryDirectory
before do before do
Pod::Source.reset!
Pod::Spec::Set.reset!
fixture('spec-repos/master') # ensure the archive is unpacked fixture('spec-repos/master') # ensure the archive is unpacked
@config_before = config @config_before = config
...@@ -264,8 +262,6 @@ else ...@@ -264,8 +262,6 @@ else
installer = SpecHelper::Installer.new(spec) installer = SpecHelper::Installer.new(spec)
installer.install! installer.install!
Pod::Source.reset!
Pod::Spec::Set.reset!
spec = Pod::Podfile.new do spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load # first ensure that the correct info is available to the specs when they load
config.rootspec = self config.rootspec = self
...@@ -281,9 +277,6 @@ else ...@@ -281,9 +277,6 @@ else
end end
it "creates a project with multiple targets" do it "creates a project with multiple targets" do
Pod::Source.reset!
Pod::Spec::Set.reset!
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load # first ensure that the correct info is available to the specs when they load
config.rootspec = self config.rootspec = self
...@@ -370,9 +363,6 @@ else ...@@ -370,9 +363,6 @@ else
end end
it "should prevent duplication cleaning headers symlinks with multiple targets" do it "should prevent duplication cleaning headers symlinks with multiple targets" do
Pod::Source.reset!
Pod::Spec::Set.reset!
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load # first ensure that the correct info is available to the specs when they load
config.rootspec = self config.rootspec = self
......
...@@ -30,18 +30,6 @@ config = Pod::Config.instance ...@@ -30,18 +30,6 @@ config = Pod::Config.instance
config.silent = true config.silent = true
config.repos_dir = SpecHelper.tmp_repos_path config.repos_dir = SpecHelper.tmp_repos_path
class Pod::Source
def self.reset!
@sources = nil
end
end
class Pod::Spec::Set
def self.reset!
@sets = nil
end
end
require 'tmpdir' require 'tmpdir'
def temporary_sandbox def temporary_sandbox
...@@ -58,5 +46,4 @@ def copy_fixture_to_pod(name, pod) ...@@ -58,5 +46,4 @@ def copy_fixture_to_pod(name, pod)
FileUtils.cp_r(path, pod.root) FileUtils.cp_r(path, pod.root)
end end
SpecHelper::Fixture.fixture('banana-lib') # ensure it exists SpecHelper::Fixture.fixture('banana-lib') # ensure it exists
...@@ -2,7 +2,6 @@ require File.expand_path('../../spec_helper', __FILE__) ...@@ -2,7 +2,6 @@ require File.expand_path('../../spec_helper', __FILE__)
describe "Pod::Resolver" do describe "Pod::Resolver" do
before do before do
Pod::Spec::Set.reset!
@config_before = config @config_before = config
Pod::Config.instance = nil Pod::Config.instance = nil
config.silent = true config.silent = true
......
...@@ -5,8 +5,6 @@ describe "Pod::Source" do ...@@ -5,8 +5,6 @@ describe "Pod::Source" do
extend SpecHelper::TemporaryDirectory extend SpecHelper::TemporaryDirectory
before do before do
Pod::Source.reset!
Pod::Spec::Set.reset!
add_repo('repo1', fixture('spec-repos/master')) add_repo('repo1', fixture('spec-repos/master'))
(config.repos_dir + 'repo1/JSONKit').rmtree (config.repos_dir + 'repo1/JSONKit').rmtree
add_repo('repo2', fixture('spec-repos/master')) add_repo('repo2', fixture('spec-repos/master'))
......
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../../../spec_helper', __FILE__)
class Pod::Spec::Set
def reset!
@required_by = []
end
end
describe "Pod::Specification::Set" do describe "Pod::Specification::Set" do
before do before do
@set = Pod::Spec::Set.new(fixture('spec-repos/master/CocoaLumberjack')) @set = Pod::Spec::Set.new(fixture('spec-repos/master/CocoaLumberjack'))
@set.reset!
end end
it "returns the name of the pod" do it "returns the name of the pod" do
...@@ -36,6 +29,12 @@ describe "Pod::Specification::Set" do ...@@ -36,6 +29,12 @@ describe "Pod::Specification::Set" do
lambda { @set.required_version }.should.raise Pod::Informative lambda { @set.required_version }.should.raise Pod::Informative
end end
it "returns that this set is only part for other pods" do
@set.required_by(Pod::Spec.new { |s| s.part_of = 'CocoaLumberjack' })
@set.required_by(Pod::Spec.new { |s| s.part_of = 'CocoaLumberjack' })
@set.should.be.only_part_of_other_pod
end
before do before do
@set.required_by(Pod::Spec.new { |s| s.dependency 'CocoaLumberjack', '< 1.2.1' }) @set.required_by(Pod::Spec.new { |s| s.dependency 'CocoaLumberjack', '< 1.2.1' })
end end
...@@ -57,13 +56,6 @@ describe "Pod::Specification::Set" do ...@@ -57,13 +56,6 @@ describe "Pod::Specification::Set" do
@set.should.not.be.only_part_of_other_pod @set.should.not.be.only_part_of_other_pod
end end
it "returns that this set is only part for other pods" do
@set.reset!
@set.required_by(Pod::Spec.new { |s| s.part_of = 'CocoaLumberjack' })
@set.required_by(Pod::Spec.new { |s| s.part_of = 'CocoaLumberjack' })
@set.should.be.only_part_of_other_pod
end
it "ignores dotfiles when getting the version directories" do it "ignores dotfiles when getting the version directories" do
`touch #{fixture('spec-repos/master/CocoaLumberjack/.DS_Store')}` `touch #{fixture('spec-repos/master/CocoaLumberjack/.DS_Store')}`
lambda { @set.versions }.should.not.raise lambda { @set.versions }.should.not.raise
......
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