spec/spec_helper.rb in cocoapods-plugins-0.1.0 vs spec/spec_helper.rb in cocoapods-plugins-0.1.1

- old
+ new

@@ -36,11 +36,10 @@ #-----------------------------------------------------------------------------# # The CocoaPods namespace # module Pod - # Disable the wrapping so the output is deterministic in the tests. # UI.disable_wrap = true # Redirects the messages to an internal store. @@ -83,21 +82,32 @@ end end #-----------------------------------------------------------------------------# -# Pod namespace +# SpecHelper namespace # module SpecHelper - # Add this as an extention into the Create specs - module PluginCreateCommand - - def argv(*args) - CLAide::ARGV.new(args) + # Add this as an extension into the Search and List specs + # to help stub the plugins.json request + module PluginsStubs + def stub_plugins_json_request(json = nil, status = 200) + body = json || File.read(fixture('plugins.json')) + stub_request(:get, Pod::Command::PluginsHelper::PLUGINS_URL) + .to_return(:status => status, :body => body, :headers => {}) end + end - def create_command(args) - Pod::Command::Plugins::Create.new(args) + # Add this as an extension into the Create specs + module PluginsCreateCommand + def create_command(*args) + Pod::Command::Plugins::Create.new CLAide::ARGV.new(args) end + end + # Add this as an extension into the Search specs + module PluginsSearchCommand + def search_command(*args) + Pod::Command::Plugins::Search.new CLAide::ARGV.new(args) + end end end