Commit d4e53411 authored by Michele's avatar Michele

[WIP] Integrating migrator with tests.

parent ac5f166c
......@@ -161,8 +161,8 @@ module Pod
#--------------------------------------#
it "returns whether the folder containing the Pod with the given name is empty" do
@analyzer.send(:folder_exist?, 'BananaLib').should.be.false
path = temporary_directory + 'Pods/BananaLib'
@analyzer.send(:folder_exist?, '\BananaLib').should.be.false
path = temporary_directory + 'Pods/Sources/BananaLib'
path.mkpath
@analyzer.send(:folder_exist?, 'BananaLib').should.be.true
......@@ -170,7 +170,7 @@ module Pod
it "returns whether the folder containing the Pod with the given name is empty" do
@analyzer.send(:folder_empty?, 'BananaLib').should.be.true
path = temporary_directory + 'Pods/BananaLib'
path = temporary_directory + 'Pods/Sources/BananaLib'
path.mkpath
File.open(path + "file", "w") {}
@analyzer.send(:folder_empty?, 'BananaLib').should.be.false
......
......@@ -29,7 +29,7 @@ module Pod
@spec.source = { :git => SpecHelper.fixture('banana-lib'), :tag => 'v1.0' }
@installer.install!
@installer.specific_source.should.be.nil
pod_folder = config.sandbox.root + 'BananaLib'
pod_folder = config.sandbox.pod_dir('BananaLib')
pod_folder.should.exist
end
......@@ -38,7 +38,7 @@ module Pod
@spec.source = { :git => SpecHelper.fixture('banana-lib'), :tag => 'v1.0' }
@installer.install!
@installer.specific_source[:commit].should == "0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc"
pod_folder = config.sandbox.root + 'BananaLib'
pod_folder = config.sandbox.pod_dir('BananaLib')
pod_folder.should.exist
end
......@@ -46,7 +46,7 @@ module Pod
@spec.source = { :git => SpecHelper.fixture('banana-lib'), :branch => 'topicbranch' }
@installer.install!
@installer.specific_source[:commit].should == "446b22414597f1bb4062a62c4eed7af9627a3f1b"
pod_folder = config.sandbox.root + 'BananaLib'
pod_folder = config.sandbox.pod_dir('BananaLib')
pod_folder.should.exist
end
......@@ -70,14 +70,14 @@ module Pod
it "cleans the paths non used by the installation" do
@installer.install!
@installer.clean!
unused_file = config.sandbox.root + 'BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file = config.sandbox.root + 'Sources/BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file.should.not.exist
end
it "preserves important files like the LICENSE and the README" do
@installer.install!
@installer.clean!
readme_file = config.sandbox.root + 'BananaLib/README'
readme_file = config.sandbox.root + 'Sources/BananaLib/README'
readme_file.should.exist
end
......@@ -120,13 +120,13 @@ module Pod
@installer.send(:download_source)
paths = @installer.send(:clean_paths)
relative_paths = paths.map { |p| p.gsub("#{temporary_directory}/", '')}
paths_without_git = relative_paths.reject { |p| p.include? 'Pods/BananaLib/.git' }
paths_without_git = relative_paths.reject { |p| p.include? 'Pods/Sources/BananaLib/.git' }
paths_without_git.sort.should == [
"Pods/BananaLib/BananaLib.podspec",
"Pods/BananaLib/libPusher",
"Pods/BananaLib/sub-dir",
"Pods/BananaLib/sub-dir/sub-dir-2",
"Pods/BananaLib/sub-dir/sub-dir-2/somefile.txt"
"Pods/Sources/BananaLib/BananaLib.podspec",
"Pods/Sources/BananaLib/libPusher",
"Pods/Sources/BananaLib/sub-dir",
"Pods/Sources/BananaLib/sub-dir/sub-dir-2",
"Pods/Sources/BananaLib/sub-dir/sub-dir-2/somefile.txt"
]
end
......@@ -135,13 +135,13 @@ module Pod
paths = @installer.send(:used_files)
relative_paths = paths.map { |p| p.gsub("#{temporary_directory}/", '')}
relative_paths.sort.should == [
"Pods/BananaLib/Classes/Banana.h",
"Pods/BananaLib/Classes/Banana.m",
"Pods/BananaLib/Classes/BananaLib.pch",
"Pods/BananaLib/Classes/BananaPrivate.h",
"Pods/BananaLib/LICENSE",
"Pods/BananaLib/README",
"Pods/BananaLib/Resources/logo-sidebar.png"
"Pods/Sources/BananaLib/Classes/Banana.h",
"Pods/Sources/BananaLib/Classes/Banana.m",
"Pods/Sources/BananaLib/Classes/BananaLib.pch",
"Pods/Sources/BananaLib/Classes/BananaPrivate.h",
"Pods/Sources/BananaLib/LICENSE",
"Pods/Sources/BananaLib/README",
"Pods/Sources/BananaLib/Resources/logo-sidebar.png"
]
end
......@@ -159,13 +159,13 @@ module Pod
paths = @installer.send(:used_files)
relative_paths = paths.map { |p| p.gsub("#{temporary_directory}/", '')}
relative_paths.sort.should == [
"Pods/BananaLib/Classes/Banana.h",
"Pods/BananaLib/Classes/Banana.m",
"Pods/BananaLib/Classes/BananaLib.pch",
"Pods/BananaLib/Classes/BananaPrivate.h",
"Pods/BananaLib/LICENSE",
"Pods/BananaLib/README",
"Pods/BananaLib/Resources/logo-sidebar.png"
"Pods/Sources/BananaLib/Classes/Banana.h",
"Pods/Sources/BananaLib/Classes/Banana.m",
"Pods/Sources/BananaLib/Classes/BananaLib.pch",
"Pods/Sources/BananaLib/Classes/BananaPrivate.h",
"Pods/Sources/BananaLib/LICENSE",
"Pods/Sources/BananaLib/README",
"Pods/Sources/BananaLib/Resources/logo-sidebar.png"
]
end
......
......@@ -16,8 +16,8 @@ module Pod
end
it "can return the relative path of a given absolute path" do
path = temporary_directory + 'Pods/BananaLib/file'
@project.relativize(path).should == Pathname.new('BananaLib/file')
path = temporary_directory + 'Pods/Sources/BananaLib/file'
@project.relativize(path).should == Pathname.new('Sources/BananaLib/file')
end
it "can return the relative path of a given absolute path outside its root" do
......
......@@ -37,7 +37,7 @@ module Pod
end
it "cleans any trace of the Pod with the given name" do
pod_root = @sandbox.root + 'BananaLib'
pod_root = @sandbox.pod_dir('BananaLib')
pod_root.mkpath
@sandbox.store_podspec('BananaLib', fixture('banana-lib/BananaLib.podspec'))
specification_path = @sandbox.specification_path('BananaLib')
......@@ -47,7 +47,7 @@ module Pod
end
it "doesn't remove the root of local Pods while cleaning" do
pod_root = @sandbox.root + 'BananaLib'
pod_root = @sandbox.pod_dir('BananaLib')
@sandbox.stubs(:local?).returns(true)
pod_root.mkpath
@sandbox.clean_pod('BananaLib')
......@@ -73,7 +73,7 @@ module Pod
end
it "returns the directory where a Pod is stored" do
@sandbox.pod_dir('JSONKit').should == temporary_directory + 'Sandbox/JSONKit'
@sandbox.pod_dir('JSONKit').should == temporary_directory + 'Sandbox/Sources/JSONKit'
end
it "returns the directory where a local Pod is stored" do
......
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