Skip to content

Commit

Permalink
fixed rspec deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Evans committed Sep 2, 2024
1 parent bf74075 commit 788e739
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/dragonfly/model/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let! :dragonfly_app do test_app(:test_ar) end

before :all do
@connection = ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")

ActiveRecord::Migration.verbose = false

Expand All @@ -27,7 +27,7 @@ class Photo < ActiveRecord::Base

after :all do
Photo.destroy_all
ActiveRecord::Base.remove_connection(@connection)
ActiveRecord::Base.remove_connection()
end

describe "destroying" do
Expand Down
2 changes: 1 addition & 1 deletion spec/dragonfly/temp_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_parts(temp_object)
end
it "should allow not creating intermediate subdirs" do
filename = 'tmp/gog/mcgee'
expect{ @temp_object.to_file(filename, :mkdirs => false) }.to raise_error()
expect{ @temp_object.to_file(filename, :mkdirs => false) }.to raise_error(/No such file or directory/)
end
end

Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
SAMPLES_DIR = Pathname.new(File.expand_path("../../samples", __FILE__))

RSpec.configure do |c|
c.expect_with(:rspec) do |expectations|
expectations.syntax = [:should, :expect]
end
c.mock_with(:rspec) do |mocks|
mocks.syntax = [:should, :expect]
end
c.include ModelHelpers
c.include RackHelpers
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/image_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def image_properties(image)
match do |actual|
value.should === image_properties(actual)[property]
end
failure_message_for_should do |actual|
failure_message do |actual|
"expected image to have #{property} #{value.inspect}, but it had #{image_properties(actual)[property].inspect}"
end
end
Expand Down

0 comments on commit 788e739

Please sign in to comment.