diff --git a/lib/oxford_dictionary/client.rb b/lib/oxford_dictionary/client.rb index a3537b4..3844695 100644 --- a/lib/oxford_dictionary/client.rb +++ b/lib/oxford_dictionary/client.rb @@ -40,6 +40,12 @@ def entry(*args) end end + def entry_snake_case(word:, dataset_name: 'en-gb', params: {}) + warn 'Client#entry_snake_case is DEPRECATED. Use Client#entry instead.' + entry_endpoint. + entry_snake_case(word: word, dataset_name: dataset_name, params: params) + end + private def entry_endpoint diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 286e9a6..d6b8e1a 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -37,4 +37,19 @@ end end end + + describe '#entry_snake_case' do + let(:client) { described_class.new(app_id: app_id, app_key: app_key) } + subject { client.entry_snake_case(word: word, params: params) } + + let(:word) { 'ace' } + let(:params) { {} } + + it 'calls Entries#entry_snake_case' do + expect_any_instance_of(OxfordDictionary::Endpoints::Entries). + to receive(:entry_snake_case). + with(word: word, dataset_name: 'en-gb', params: params) + subject + end + end end