Sha256: 18c664c516278f2b1ef211bcb5f61ea5902514c104a8a299f32de384464cfbad
Contents?: true
Size: 1.13 KB
Versions: 17
Compression:
Stored size: 1.13 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') api_stub.expects(:clean_cache) HammerCLI::Apipie::ApiConnection.new(empty_params, :reload_cache => true, :logger => logger) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems