Skip to content

Commit 788e739

Browse files
author
Mark Evans
committed
fixed rspec deprecation warnings
1 parent bf74075 commit 788e739

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

spec/dragonfly/model/active_record_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
let! :dragonfly_app do test_app(:test_ar) end
1010

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

1414
ActiveRecord::Migration.verbose = false
1515

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

2828
after :all do
2929
Photo.destroy_all
30-
ActiveRecord::Base.remove_connection(@connection)
30+
ActiveRecord::Base.remove_connection()
3131
end
3232

3333
describe "destroying" do

spec/dragonfly/temp_object_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_parts(temp_object)
145145
end
146146
it "should allow not creating intermediate subdirs" do
147147
filename = 'tmp/gog/mcgee'
148-
expect{ @temp_object.to_file(filename, :mkdirs => false) }.to raise_error()
148+
expect{ @temp_object.to_file(filename, :mkdirs => false) }.to raise_error(/No such file or directory/)
149149
end
150150
end
151151

spec/spec_helper.rb

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
SAMPLES_DIR = Pathname.new(File.expand_path("../../samples", __FILE__))
1818

1919
RSpec.configure do |c|
20+
c.expect_with(:rspec) do |expectations|
21+
expectations.syntax = [:should, :expect]
22+
end
23+
c.mock_with(:rspec) do |mocks|
24+
mocks.syntax = [:should, :expect]
25+
end
2026
c.include ModelHelpers
2127
c.include RackHelpers
2228
end

spec/support/image_matchers.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def image_properties(image)
2222
match do |actual|
2323
value.should === image_properties(actual)[property]
2424
end
25-
failure_message_for_should do |actual|
25+
failure_message do |actual|
2626
"expected image to have #{property} #{value.inspect}, but it had #{image_properties(actual)[property].inspect}"
2727
end
2828
end

0 commit comments

Comments
 (0)