forked from CocoaPods/Xcodeproj
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Specs] Added specifications for more concrete subclasses.
- Loading branch information
1 parent
2af78a0
commit 5f19520
Showing
9 changed files
with
247 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
module ProjectSpecs | ||
describe PBXBuildFile do | ||
|
||
before do | ||
@file = @project.new(PBXBuildFile) | ||
end | ||
|
||
it "defaults the settings to the empty hash" do | ||
@file.settings.should == {} | ||
end | ||
|
||
it "returns the file reference" do | ||
@file.file_ref = @project.new(PBXFileReference) | ||
@file.file_ref.class.should == PBXFileReference | ||
end | ||
|
||
it "accepts a variant group and a version group as a reference" do | ||
lambda { @file.file_ref = @project.new(PBXVariantGroup) }.should.not.raise | ||
lambda { @file.file_ref = @project.new(XCVersionGroup) }.should.not.raise | ||
end | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
module ProjectSpecs | ||
describe PBXBuildRule do | ||
|
||
before do | ||
@rule = @project.new(PBXBuildRule) | ||
end | ||
|
||
it "returns the name" do | ||
@rule.name = "myRule" | ||
@rule.name.should == "myRule" | ||
end | ||
|
||
it "returns the compiler spec" do | ||
@rule.compiler_spec = "com.apple.compilers.proxy.script" | ||
@rule.compiler_spec.should == "com.apple.compilers.proxy.script" | ||
end | ||
|
||
it "returns the file type of the rule" do | ||
@rule.file_type = "pattern.proxy" | ||
@rule.file_type.should == "pattern.proxy" | ||
end | ||
|
||
it "returns whether the rule is editable" do | ||
@rule.is_editable = '1' | ||
@rule.is_editable.should == '1' | ||
end | ||
|
||
it "returns the output files of the rule" do | ||
f = @project.new(PBXFileReference) | ||
@rule.output_files << f | ||
@rule.output_files.count.should == 1 | ||
@rule.output_files.should.include?(f) | ||
end | ||
|
||
it "returns the script of the rule" do | ||
@rule.script = 'echo "BABY COOL"' | ||
@rule.script.should == 'echo "BABY COOL"' | ||
end | ||
|
||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
module ProjectSpecs | ||
describe XCBuildConfiguration do | ||
|
||
before do | ||
@list = @project.new(XCConfigurationList) | ||
end | ||
|
||
it "by the default the default configutation is not visible" do | ||
@list.default_configuration_is_visible.should == '0' | ||
end | ||
|
||
it "returns the default configuration name" do | ||
@list.default_configuration_name = 'Release' | ||
@list.default_configuration_name.should == 'Release' | ||
end | ||
|
||
it "returns the configurations" do | ||
configuration = @project.new(XCBuildConfiguration) | ||
@list.build_configurations.to_a.should == [] | ||
@list.build_configurations << configuration | ||
@list.build_configurations.count.should == 1 | ||
@list.build_configurations.should.include?(configuration) | ||
end | ||
|
||
it "returns the build settings of a configuration given its name" do | ||
settings = { 'GCC_VERSION' => 'com.apple.compilers.llvm.clang.1_0'} | ||
configuration = @project.new(XCBuildConfiguration) | ||
configuration.name = 'Debug' | ||
configuration.build_settings = settings | ||
@list.build_configurations << configuration | ||
@list.build_settings('Debug').should == settings | ||
end | ||
|
||
end | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
module ProjectSpecs | ||
describe PBXContainerItemProxy do | ||
|
||
before do | ||
@proxy = @project.new(PBXContainerItemProxy) | ||
end | ||
|
||
it "returns the container portal" do | ||
@proxy.container_portal = @project.root_object | ||
@proxy.container_portal.should == @project.root_object | ||
end | ||
|
||
it "returns the type of the proxy" do | ||
@proxy.proxy_type = "1" | ||
@proxy.proxy_type.should == "1" | ||
end | ||
|
||
it "returns the remote global id string" do | ||
target = @project.new_target(:static, "Pods", :ios) | ||
@proxy.remote_global_id_string = target.uuid | ||
@proxy.remote_global_id_string.should == target.uuid | ||
end | ||
|
||
it "returns the remote info" do | ||
@proxy.remote_info = "Pods" | ||
@proxy.remote_info.should == "Pods" | ||
end | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
module ProjectSpecs | ||
describe PBXProject do | ||
|
||
before do | ||
@project.new_target(:static, "Pods", :ios) | ||
@root_object = @project.root_object | ||
end | ||
|
||
it "returns the targets" do | ||
@root_object.targets.map(&:name).should == ["Pods"] | ||
end | ||
|
||
it "returns the attributes" do | ||
@root_object.attributes["LastUpgradeCheck"].should.not.be.nil | ||
end | ||
|
||
it "returns the build configuration list" do | ||
@root_object.build_configuration_list.class.should == XCConfigurationList | ||
end | ||
|
||
it "returns the compatibility version" do | ||
@root_object.compatibility_version.should.include("Xcode") | ||
end | ||
|
||
it "returns the development region" do | ||
@root_object.development_region.should == "English" | ||
end | ||
|
||
it "returns whether has scanned for encodings" do | ||
@root_object.has_scanned_for_encodings.should == '0' | ||
end | ||
|
||
it "returns the known regions" do | ||
@root_object.known_regions.should == %w[en] | ||
end | ||
|
||
it "returns the main group" do | ||
@root_object.main_group.class.should == PBXGroup | ||
end | ||
|
||
it "returns the products group" do | ||
@root_object.product_ref_group.class.should == PBXGroup | ||
end | ||
|
||
it "returns the project dir path" do | ||
@root_object.project_dir_path = "some/path" | ||
@root_object.project_dir_path.should == "some/path" | ||
end | ||
|
||
it "returns the project root" do | ||
@root_object.project_root = "some/path" | ||
@root_object.project_root.should == "some/path" | ||
end | ||
|
||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
module ProjectSpecs | ||
describe PBXTargetDependency do | ||
|
||
before do | ||
@dep = @project.new(PBXTargetDependency) | ||
end | ||
|
||
it "returns the target on which this dependency is based" do | ||
@dep.target = @project.new_target(:static, "Pods", :ios) | ||
@dep.target.name.should == "Pods" | ||
end | ||
|
||
it "returns the proxy of the target on which this dependency is based" do | ||
target = @project.new_target(:static, "Pods", :ios) | ||
|
||
proxy = @project.new(PBXContainerItemProxy) | ||
proxy.container_portal = @project.root_object | ||
proxy.remote_info = "Pods" | ||
proxy.proxy_type = "1" | ||
proxy.remote_global_id_string = target.uuid | ||
|
||
@dep.targetProxy = proxy | ||
@dep.targetProxy.remote_info.should == "Pods" | ||
end | ||
|
||
|
||
end | ||
end | ||
|
||
|
||
|