@@ -14,16 +14,16 @@ module ProjectSpecs
1414
1515 it 'writes an XML plist file' do
1616 hash = { 'archiveVersion' => '1.0' }
17- Xcodeproj :: PlistHelper . write ( hash , @plist )
18- result = Xcodeproj :: PlistHelper . read ( @plist )
17+ Xcodeproj . write_plist ( hash , @plist )
18+ result = Xcodeproj . read_plist ( @plist )
1919 result . should == hash
2020 @plist . read . should . include ( '?xml' )
2121 end
2222
2323 it 'reads an ASCII plist file' do
2424 dir = 'Sample Project/Cocoa Application.xcodeproj/'
2525 path = fixture_path ( dir + 'project.pbxproj' )
26- result = Xcodeproj :: PlistHelper . read ( path )
26+ result = Xcodeproj . read_plist ( path )
2727 result . keys . should . include? ( 'archiveVersion' )
2828 end
2929
@@ -42,7 +42,7 @@ module ProjectSpecs
4242 # rubocop:enable Style/Tab
4343
4444 hash = { 'archiveVersion' => '1.0' }
45- Xcodeproj :: PlistHelper . write ( hash , @plist )
45+ Xcodeproj . write_plist ( hash , @plist )
4646 @plist . read . should == output
4747 end
4848
@@ -55,34 +55,34 @@ module ProjectSpecs
5555
5656 it 'coerces the given path object to a string path' do
5757 # @plist is a Pathname
58- Xcodeproj :: PlistHelper . write ( { } , @plist )
59- Xcodeproj :: PlistHelper . read ( @plist ) . should == { }
58+ Xcodeproj . write_plist ( { } , @plist )
59+ Xcodeproj . read_plist ( @plist ) . should == { }
6060 end
6161
6262 it "raises when the given path can't be coerced into a string path" do
63- lambda { Xcodeproj :: PlistHelper . write ( { } , Object . new ) } . should . raise TypeError
63+ lambda { Xcodeproj . write_plist ( { } , Object . new ) } . should . raise TypeError
6464 end
6565
6666 it "raises if the given path doesn't exist" do
67- lambda { Xcodeproj :: PlistHelper . read ( 'doesnotexist' ) } . should . raise ArgumentError
67+ lambda { Xcodeproj . read_plist ( 'doesnotexist' ) } . should . raise ArgumentError
6868 end
6969
7070 it 'coerces the given hash to a Hash' do
7171 o = Object . new
7272 def o . to_hash
7373 { 'from' => 'object' }
7474 end
75- Xcodeproj :: PlistHelper . write ( o , @plist )
76- Xcodeproj :: PlistHelper . read ( @plist ) . should == { 'from' => 'object' }
75+ Xcodeproj . write_plist ( o , @plist )
76+ Xcodeproj . read_plist ( @plist ) . should == { 'from' => 'object' }
7777 end
7878
7979 it "raises when given a hash that can't be coerced to a Hash" do
80- lambda { Xcodeproj :: PlistHelper . write ( Object . new , @plist ) } . should . raise TypeError
80+ lambda { Xcodeproj . write_plist ( Object . new , @plist ) } . should . raise TypeError
8181 end
8282
8383 it 'coerces keys to strings' do
84- Xcodeproj :: PlistHelper . write ( { 1 => '1' , :symbol => 'symbol' } , @plist )
85- Xcodeproj :: PlistHelper . read ( @plist ) . should == { '1' => '1' , 'symbol' => 'symbol' }
84+ Xcodeproj . write_plist ( { 1 => '1' , :symbol => 'symbol' } , @plist )
85+ Xcodeproj . read_plist ( @plist ) . should == { '1' => '1' , 'symbol' => 'symbol' }
8686 end
8787
8888 it 'allows hashes, strings, booleans, and arrays of hashes and strings as values' do
@@ -93,19 +93,19 @@ def o.to_hash
9393 'false_bool' => false ,
9494 'array' => [ 'string in an array' , { 'a hash' => 'in an array' } ] ,
9595 }
96- Xcodeproj :: PlistHelper . write ( hash , @plist )
97- Xcodeproj :: PlistHelper . read ( @plist ) . should == hash
96+ Xcodeproj . write_plist ( hash , @plist )
97+ Xcodeproj . read_plist ( @plist ) . should == hash
9898 end
9999
100100 it 'coerces values to strings if it is a disallowed type' do
101- Xcodeproj :: PlistHelper . write ( { '1' => 1 , 'symbol' => :symbol } , @plist )
102- Xcodeproj :: PlistHelper . read ( @plist ) . should == { '1' => '1' , 'symbol' => 'symbol' }
101+ Xcodeproj . write_plist ( { '1' => 1 , 'symbol' => :symbol } , @plist )
102+ Xcodeproj . read_plist ( @plist ) . should == { '1' => '1' , 'symbol' => 'symbol' }
103103 end
104104
105105 it 'handles unicode characters in paths and strings' do
106106 plist = @plist . to_s + 'øµ'
107- Xcodeproj :: PlistHelper . write ( { 'café' => 'før yoµ' } , plist )
108- Xcodeproj :: PlistHelper . read ( plist ) . should == { 'café' => 'før yoµ' }
107+ Xcodeproj . write_plist ( { 'café' => 'før yoµ' } , plist )
108+ Xcodeproj . read_plist ( plist ) . should == { 'café' => 'før yoµ' }
109109 end
110110
111111 it 'raises if a plist contains any other object type as value than string, dictionary, and array' do
@@ -121,7 +121,7 @@ def o.to_hash
121121</plist>
122122EOS
123123 end
124- lambda { Xcodeproj :: PlistHelper . read ( @plist ) } . should . raise TypeError
124+ lambda { Xcodeproj . read_plist ( @plist ) } . should . raise TypeError
125125 end
126126
127127 it 'raises if a plist array value contains any other object type than string, or dictionary' do
@@ -139,12 +139,12 @@ def o.to_hash
139139</plist>
140140EOS
141141 end
142- lambda { Xcodeproj :: PlistHelper . read ( @plist ) } . should . raise TypeError
142+ lambda { Xcodeproj . read_plist ( @plist ) } . should . raise TypeError
143143 end
144144
145145 it 'raises if for whatever reason the value could not be converted to a CFTypeRef' do
146146 lambda do
147- Xcodeproj :: PlistHelper . write ( { 'invalid' => "\xCA " } , @plist )
147+ Xcodeproj . write_plist ( { 'invalid' => "\xCA " } , @plist )
148148 end . should . raise TypeError
149149 end
150150
0 commit comments