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