Skip to content

Commit 4737ad2

Browse files
committed
Removes trailing whitespace
1 parent 698b03e commit 4737ad2

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

spec/rspec/rails/mocks/mock_model_spec.rb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'spec_helper'
22

33
describe "mock_model(RealModel)" do
4-
54
context "given a String" do
65
context "that does not represent an existing constant" do
76
it "class says it's name" do
@@ -121,15 +120,15 @@
121120
before(:each) do
122121
@model = mock_model(SubMockableModel)
123122
end
124-
123+
125124
it "says it is_a?(RealModel)" do
126125
@model.is_a?(SubMockableModel).should be(true)
127126
end
128-
127+
129128
it "says it is_a?(OtherModel) if RealModel is an ancestors" do
130129
@model.is_a?(MockableModel).should be(true)
131130
end
132-
131+
133132
it "can be stubbed" do
134133
mock_model(MockableModel, :is_a? => true).is_a?(:Foo).should be_truthy
135134
end
@@ -139,15 +138,15 @@
139138
before(:each) do
140139
@model = mock_model(SubMockableModel)
141140
end
142-
141+
143142
it "says it is kind_of? if RealModel is" do
144143
@model.kind_of?(SubMockableModel).should be(true)
145144
end
146-
145+
147146
it "says it is kind_of? if RealModel's ancestor is" do
148147
@model.kind_of?(MockableModel).should be(true)
149148
end
150-
149+
151150
it "can be stubbed" do
152151
mock_model(MockableModel, :kind_of? => true).kind_of?(:Foo).should be_truthy
153152
end
@@ -157,15 +156,15 @@
157156
before(:each) do
158157
@model = mock_model(SubMockableModel)
159158
end
160-
159+
161160
it "says it is instance_of? if RealModel is" do
162161
@model.instance_of?(SubMockableModel).should be(true)
163162
end
164-
163+
165164
it "does not say it instance_of? if RealModel isn't, even if it's ancestor is" do
166165
@model.instance_of?(MockableModel).should be(false)
167166
end
168-
167+
169168
it "can be stubbed" do
170169
mock_model(MockableModel, :instance_of? => true).instance_of?(:Foo).should be_truthy
171170
end
@@ -223,7 +222,7 @@
223222
@model.respond_to?("title_before_type_cast").should be(false)
224223
end
225224
end
226-
225+
227226
context "with as_null_object" do
228227
it "says it will respond_to?(key) if RealModel has the attribute 'key'" do
229228
@model.as_null_object.respond_to?("column_a").should be(true)
@@ -247,25 +246,25 @@
247246
model = NonActiveRecordModel.new
248247
model.should respond_to(:to_param)
249248
end
250-
249+
251250
context "with as_null_object" do
252251
it "says it will not respond_to?(xxx_before_type_cast)" do
253252
model = NonActiveRecordModel.new.as_null_object
254253
model.respond_to?("title_before_type_cast").should be(false)
255254
end
256255
end
257256
end
258-
257+
259258
it "can be stubbed" do
260259
mock_model(MockableModel, :respond_to? => true).respond_to?(:foo).should be_truthy
261260
end
262261
end
263-
262+
264263
describe "#class" do
265264
it "returns the mocked model" do
266265
mock_model(MockableModel).class.should eq(MockableModel)
267266
end
268-
267+
269268
it "can be stubbed" do
270269
mock_model(MockableModel, :class => String).class.should be(String)
271270
end
@@ -275,7 +274,7 @@
275274
it "returns (model.name)_(model#to_param)" do
276275
mock_model(MockableModel).to_s.should == "MockableModel_#{to_param}"
277276
end
278-
277+
279278
it "can be stubbed" do
280279
mock_model(MockableModel, :to_s => "this string").to_s.should == "this string"
281280
end
@@ -325,7 +324,7 @@
325324
mock_model(MockableModel).should be_valid
326325
end
327326
end
328-
327+
329328
context "stubbed with false" do
330329
it "returns false" do
331330
mock_model(MockableModel, :valid? => false).should_not be_valid

0 commit comments

Comments
 (0)