Commit 62ddb8e8 authored by Marcel Jackwerth's avatar Marcel Jackwerth

[Validator] Improve regression test for `undefined method `spec_consumer'`

- let spec in "validates a podspec with dependencies" validate
- fixed a bug in `write_podspec`
parent 568b87fe
...@@ -6,7 +6,7 @@ module Pod ...@@ -6,7 +6,7 @@ module Pod
# @return [void] # @return [void]
# #
def write_podspec(text, name = 'JSONKit.podspec') def write_podspec(text, name = 'JSONKit.podspec')
file = temporary_directory + 'JSONKit.podspec' file = temporary_directory + name
File.open(file, 'w') {|f| f.write(text) } File.open(file, 'w') {|f| f.write(text) }
file file
end end
...@@ -67,14 +67,15 @@ module Pod ...@@ -67,14 +67,15 @@ module Pod
it "validates a podspec with dependencies" do it "validates a podspec with dependencies" do
podspec = stub_podspec(/s.name.*$/, 's.name = "ZKit"') podspec = stub_podspec(/s.name.*$/, 's.name = "ZKit"')
podspec.gsub! /s.requires_arc/, "s.dependency 'SBJson', '~> 3.2'\n s.requires_arc" podspec.gsub!(/s.requires_arc/, "s.dependency 'SBJson', '~> 3.2'\n s.requires_arc")
podspec.gsub!(/s.license.*$/, 's.license = "Public Domain"')
file = write_podspec(podspec, "ZKit.podspec") file = write_podspec(podspec, "ZKit.podspec")
spec = Specification.from_file(file) spec = Specification.from_file(file)
validator = Validator.new(spec) validator = Validator.new(spec)
validator.validate validator.validate
validator.results.map(&:to_s).first.should.match /should match the name/ validator.results.should.be.empty
validator.validated?.should.be.false validator.validated?.should.be.true
end end
#--------------------------------------# #--------------------------------------#
......
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