Commit 8aa6948e by jonoterc

switch deprecated "mock" for "double" in annotate specs

changing to get rid of deprecation warnings
parent f9ebcded
......@@ -6,14 +6,14 @@ require 'annotate/active_record_patch'
describe AnnotateModels do
def mock_class(table_name, primary_key, columns)
options = {
:connection => mock("Conn", :indexes => []),
:connection => double("Conn", :indexes => []),
:table_name => table_name,
:primary_key => primary_key,
:column_names => columns.map { |col| col.name.to_s },
:columns => columns
}
mock("An ActiveRecord class", options)
double("An ActiveRecord class", options)
end
def mock_column(name, type, options={})
......@@ -27,7 +27,7 @@ describe AnnotateModels do
stubs.merge!(options)
stubs.merge!(:name => name, :type => type)
mock("Column", stubs)
double("Column", stubs)
end
it { AnnotateModels.quote(nil).should eql("NULL") }
......
......@@ -4,7 +4,7 @@ require 'annotate/annotate_routes'
describe AnnotateRoutes do
def mock_file(stubs={})
@mock_file ||= mock(File, stubs)
@mock_file ||= double(File, stubs)
end
it "should check if routes.rb exists" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment