Sha256: 1da446760dbbd5147a990d38d775800770bb769548c9d7a20f60bda6f2ba1ef6
Contents?: true
Size: 1.2 KB
Versions: 28
Compression:
Stored size: 1.2 KB
Contents
require File.join(File.dirname(__FILE__), '../../test_helper') describe HammerCLI::Apipie::ApiConnection do let(:connection) { HammerCLI::Connection.new } describe '#initialize' do let(:empty_params) {{}} def api_stub(params = {}, options = {}) api_stub = stub() options[:verify_ssl] = true if options[:verify_ssl].nil? ApipieBindings::API.expects(:new).with(params, options).returns(api_stub) api_stub end it "passes attributes to apipie bindings" do params = { :apidoc_cache_name => 'test.example.com' } api_stub(params) HammerCLI::Apipie::ApiConnection.new(params) end context "with :clear_cache => true" do it "clears cache" do api_stub.expects(:clean_cache) HammerCLI::Apipie::ApiConnection.new(empty_params, :reload_cache => true) end it "logs message when logger is available" do logger = stub() logger.expects(:debug).with('Apipie cache was cleared') logger.expects(:debug).with('Completion cache was cleared') api_stub.expects(:clean_cache) HammerCLI::Apipie::ApiConnection.new(empty_params, :reload_cache => true, :logger => logger) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems