Merge pull request #4214 from reitermarkus/fix-rspec-deprecations
Fix `rspec` deprecations.
This commit is contained in:
commit
963adfafc3
@ -21,7 +21,7 @@ describe CacheStoreDatabase do
|
|||||||
allow(File).to receive(:write)
|
allow(File).to receive(:write)
|
||||||
allow(subject).to receive(:created?).and_return(true)
|
allow(subject).to receive(:created?).and_return(true)
|
||||||
expect(db).to receive(:has_key?).with(:foo).and_return(false)
|
expect(db).to receive(:has_key?).with(:foo).and_return(false)
|
||||||
subject.stub(:db).and_return(db)
|
allow(subject).to receive(:db).and_return(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "sets the value in the `CacheStoreDatabase`" do
|
it "sets the value in the `CacheStoreDatabase`" do
|
||||||
@ -37,7 +37,7 @@ describe CacheStoreDatabase do
|
|||||||
before(:each) do
|
before(:each) do
|
||||||
allow(subject).to receive(:created?).and_return(true)
|
allow(subject).to receive(:created?).and_return(true)
|
||||||
expect(db).to receive(:has_key?).with(:foo).and_return(true)
|
expect(db).to receive(:has_key?).with(:foo).and_return(true)
|
||||||
subject.stub(:db).and_return(db)
|
allow(subject).to receive(:db).and_return(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "gets value in the `CacheStoreDatabase` corresponding to the key" do
|
it "gets value in the `CacheStoreDatabase` corresponding to the key" do
|
||||||
@ -51,7 +51,7 @@ describe CacheStoreDatabase do
|
|||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
allow(subject).to receive(:created?).and_return(false)
|
allow(subject).to receive(:created?).and_return(false)
|
||||||
subject.stub(:db).and_return(db)
|
allow(subject).to receive(:db).and_return(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not get value in the `CacheStoreDatabase` corresponding to key" do
|
it "does not get value in the `CacheStoreDatabase` corresponding to key" do
|
||||||
@ -71,7 +71,7 @@ describe CacheStoreDatabase do
|
|||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
allow(subject).to receive(:created?).and_return(true)
|
allow(subject).to receive(:created?).and_return(true)
|
||||||
subject.stub(:db).and_return(db)
|
allow(subject).to receive(:db).and_return(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "deletes value in the `CacheStoreDatabase` corresponding to the key" do
|
it "deletes value in the `CacheStoreDatabase` corresponding to the key" do
|
||||||
@ -85,7 +85,7 @@ describe CacheStoreDatabase do
|
|||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
allow(subject).to receive(:created?).and_return(false)
|
allow(subject).to receive(:created?).and_return(false)
|
||||||
subject.stub(:db).and_return(db)
|
allow(subject).to receive(:db).and_return(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not call `db.delete` if `CacheStoreDatabase.created?` is `false`" do
|
it "does not call `db.delete` if `CacheStoreDatabase.created?` is `false`" do
|
||||||
@ -121,7 +121,7 @@ describe CacheStoreDatabase do
|
|||||||
let(:cache_path) { "path/to/homebrew/cache/sample.db" }
|
let(:cache_path) { "path/to/homebrew/cache/sample.db" }
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
subject.stub(:cache_path).and_return(cache_path)
|
allow(subject).to receive(:cache_path).and_return(cache_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
context "`File.exist?(cache_path)` returns `true`" do
|
context "`File.exist?(cache_path)` returns `true`" do
|
||||||
|
@ -41,6 +41,8 @@ TEST_DIRECTORIES = [
|
|||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.order = :random
|
config.order = :random
|
||||||
|
|
||||||
|
config.raise_errors_for_deprecations!
|
||||||
|
|
||||||
config.filter_run_when_matching :focus
|
config.filter_run_when_matching :focus
|
||||||
|
|
||||||
# TODO: when https://github.com/rspec/rspec-expectations/pull/1056
|
# TODO: when https://github.com/rspec/rspec-expectations/pull/1056
|
||||||
|
Loading…
x
Reference in New Issue
Block a user