This repository was archived by the owner on Sep 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 22
33module Swiftype
44 extend Swiftype ::Configuration
5+
6+ def self . const_missing ( const_name )
7+ super unless const_name == :Easy
8+ warn "`Swiftype::Easy` has been deprecated. Use `Swiftype::Client` instead."
9+ Client
10+ end
511end
612
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ module Swiftype
77 class Client
88 include Swiftype ::Request
99
10+ def self . configure ( &block )
11+ warn "`Swiftype::Easy.configure` has been deprecated. Use `Swiftype.configure` instead."
12+ Swiftype . configure &block
13+ end
14+
1015 # Create a new Swiftype::Client client
1116 #
1217 # @param options [Hash] a hash of configuration options that will overrided what is set on the Swiftype class.
Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ describe 'deprecated classes and methods' do
4+ context 'Swiftype::Easy' do
5+ it 'returns Swiftype::Client' do
6+ Swiftype ::Easy . should == Swiftype ::Client
7+ end
8+ end
9+
10+ context 'Swiftype::Easy.configure' do
11+ it 'calls warn and calls Swiftype.configure' do
12+ Swiftype ::Client . should_receive ( :warn )
13+ Swiftype ::Easy . configure do |config |
14+ config . api_key = 'got set'
15+ end
16+
17+ Swiftype . api_key . should == 'got set'
18+ end
19+ end
20+ end
You can’t perform that action at this time.
0 commit comments