Skip to content

Commit 224aeb0

Browse files
committed
Use pre 3.0 compatible stubbing
`receive_messages` is not available pre 3.0. This will let the test suite run with an earlier version of rspec.
1 parent 91d4c1b commit 224aeb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/rspec/active_model/mocks/mock_model_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@
229229
expect(model.column_a).to eq("a")
230230
end
231231
it "does not stub column accessor if already stubbed after declaration (with string)" do
232-
allow(@model).to receive_messages("column_a" => "a")
232+
allow(@model).to receive(:column_a) { "a" }
233233
@model.respond_to?("column_a")
234234
expect(@model.column_a).to eq("a")
235235
end
236236
it "does not stub column accessor if already stubbed after declaration (with symbol)" do
237-
allow(@model).to receive_messages(:column_a => "a")
237+
allow(@model).to receive(:column_a) { "a" }
238238
@model.respond_to?("column_a")
239239
expect(@model.column_a).to eq("a")
240240
end

0 commit comments

Comments
 (0)