Skip to content

Commit

Permalink
Revert to single test of spelling deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
ellnix committed Jan 4, 2025
1 parent c283642 commit 1ff8e9e
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions spec/meilisearch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@
end

RSpec.describe MeiliSearch do
it 'using a constant warns about deprecation, returns correct constant' do
it 'relays constants & messages, warns about deprecation only once' do
logger = instance_double(Logger, warn: nil)
Meilisearch::Utils.logger = logger
MeiliSearch.instance_variable_set('@warned', false)

expect(MeiliSearch::Index).to equal(Meilisearch::Index)
expect(MeiliSearch::Task).to equal(Meilisearch::Task)
Expand All @@ -53,20 +52,4 @@

Meilisearch::Utils.logger = nil
end

it 'calling a method warns about deprecation, calls the right method' do
logger = instance_double(Logger, warn: nil)
Meilisearch::Utils.logger = logger
MeiliSearch.instance_variable_set('@warned', false)

expect(MeiliSearch.qualified_version).to eq(Meilisearch.qualified_version)
expect(MeiliSearch::Index).to equal(Meilisearch::Index)
expect(MeiliSearch::Task).to equal(Meilisearch::Task)

expect(logger).to have_received(:warn)
.with(a_string_including('The top-level module of Meilisearch has been renamed.'))
.once

Meilisearch::Utils.logger = nil
end
end

0 comments on commit 1ff8e9e

Please sign in to comment.