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' ...@@ -6,14 +6,14 @@ require 'annotate/active_record_patch'
describe AnnotateModels do describe AnnotateModels do
def mock_class(table_name, primary_key, columns) def mock_class(table_name, primary_key, columns)
options = { options = {
:connection => mock("Conn", :indexes => []), :connection => double("Conn", :indexes => []),
:table_name => table_name, :table_name => table_name,
:primary_key => primary_key, :primary_key => primary_key,
:column_names => columns.map { |col| col.name.to_s }, :column_names => columns.map { |col| col.name.to_s },
:columns => columns :columns => columns
} }
mock("An ActiveRecord class", options) double("An ActiveRecord class", options)
end end
def mock_column(name, type, options={}) def mock_column(name, type, options={})
...@@ -27,7 +27,7 @@ describe AnnotateModels do ...@@ -27,7 +27,7 @@ describe AnnotateModels do
stubs.merge!(options) stubs.merge!(options)
stubs.merge!(:name => name, :type => type) stubs.merge!(:name => name, :type => type)
mock("Column", stubs) double("Column", stubs)
end end
it { AnnotateModels.quote(nil).should eql("NULL") } it { AnnotateModels.quote(nil).should eql("NULL") }
......
...@@ -4,7 +4,7 @@ require 'annotate/annotate_routes' ...@@ -4,7 +4,7 @@ require 'annotate/annotate_routes'
describe AnnotateRoutes do describe AnnotateRoutes do
def mock_file(stubs={}) def mock_file(stubs={})
@mock_file ||= mock(File, stubs) @mock_file ||= double(File, stubs)
end end
it "should check if routes.rb exists" do 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