Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

be_true -> be_truthy, be_false -> be_falsey

  • Loading branch information...
commit 263b95392492dac2b83484946493ed9b633fa155 1 parent 48b24d4
@alindeman alindeman authored
View
2  features/controller_specs/anonymous_controller.feature
@@ -144,7 +144,7 @@ Feature: anonymous controller
it "invokes the callback" do
get :index
- expect(assigns[:callback_invoked]).to be_true
+ expect(assigns[:callback_invoked]).to be_truthy
end
end
"""
View
6 features/mocks/mock_model.feature
@@ -18,9 +18,9 @@ Feature: mock_model
describe "mock_model('Car') with no Car constant in existence" do
it "generates a constant" do
- expect(Object.const_defined?(:Car)).to be_false
+ expect(Object.const_defined?(:Car)).to be_falsey
mock_model("Car")
- expect(Object.const_defined?(:Car)).to be_true
+ expect(Object.const_defined?(:Car)).to be_truthy
end
describe "generates an object that ..." do
@@ -115,7 +115,7 @@ Feature: mock_model
it "supports stubs for methods that do exist" do
expect(widget.save).to eq(true)
- expect(widget.update_attributes).to be_false
+ expect(widget.update_attributes).to be_falsey
end
describe "#errors" do
View
2  features/mocks/stub_model.feature
@@ -21,7 +21,7 @@ Feature: stub_model
end
it "stubs :random_attribute" do
- expect(widget.random_attribute).to be_true
+ expect(widget.random_attribute).to be_truthy
end
it "returns false for new_record? if :id is set" do
View
4 spec/rspec/rails/configuration_spec.rb
@@ -11,7 +11,7 @@
describe "#render_views?" do
it "is false by default" do
- RSpec.configuration.render_views?.should be_false
+ RSpec.configuration.render_views?.should be_falsey
end
end
@@ -20,7 +20,7 @@
RSpec.configuration.render_views = false
RSpec.configuration.render_views
- RSpec.configuration.render_views?.should be_true
+ RSpec.configuration.render_views?.should be_truthy
end
end
end
View
8 spec/rspec/rails/mocks/mock_model_spec.rb
@@ -131,7 +131,7 @@
end
it "can be stubbed" do
- mock_model(MockableModel, :is_a? => true).is_a?(:Foo).should be_true
+ mock_model(MockableModel, :is_a? => true).is_a?(:Foo).should be_truthy
end
end
@@ -149,7 +149,7 @@
end
it "can be stubbed" do
- mock_model(MockableModel, :kind_of? => true).kind_of?(:Foo).should be_true
+ mock_model(MockableModel, :kind_of? => true).kind_of?(:Foo).should be_truthy
end
end
@@ -167,7 +167,7 @@
end
it "can be stubbed" do
- mock_model(MockableModel, :instance_of? => true).instance_of?(:Foo).should be_true
+ mock_model(MockableModel, :instance_of? => true).instance_of?(:Foo).should be_truthy
end
end
@@ -257,7 +257,7 @@
end
it "can be stubbed" do
- mock_model(MockableModel, :respond_to? => true).respond_to?(:foo).should be_true
+ mock_model(MockableModel, :respond_to? => true).respond_to?(:foo).should be_truthy
end
end
View
4 spec/rspec/rails/mocks/stub_model_spec.rb
@@ -58,14 +58,14 @@ def model_class
context "default" do
it "returns false" do
model = stub_model(model_class)
- model.new_record?.should be_false
+ model.new_record?.should be_falsey
end
end
context "with as_new_record" do
it "returns true" do
model = stub_model(model_class).as_new_record
- model.new_record?.should be_true
+ model.new_record?.should be_truthy
end
end
end
View
26 spec/rspec/rails/view_rendering_spec.rb
@@ -14,11 +14,11 @@ def controller
context "default" do
context "ActionController::Base" do
it "does not render views" do
- group.new.render_views?.should be_false
+ group.new.render_views?.should be_falsey
end
it "does not render views in a nested group" do
- group.describe{}.new.render_views?.should be_false
+ group.describe{}.new.render_views?.should be_falsey
end
end
@@ -28,7 +28,7 @@ def controller
def example.controller
ActionController::Metal.new
end
- example.render_views?.should be_true
+ example.render_views?.should be_truthy
end
end
end
@@ -38,27 +38,27 @@ def example.controller
context "with no args" do
it "tells examples to render views" do
group.render_views
- group.new.render_views?.should be_true
+ group.new.render_views?.should be_truthy
end
end
context "with true" do
it "tells examples to render views" do
group.render_views true
- group.new.render_views?.should be_true
+ group.new.render_views?.should be_truthy
end
end
context "with false" do
it "tells examples not to render views" do
group.render_views false
- group.new.render_views?.should be_false
+ group.new.render_views?.should be_falsey
end
it "overrides the global config if render_views is enabled there" do
RSpec.configuration.stub(:render_views?).and_return true
group.render_views false
- group.new.render_views?.should be_false
+ group.new.render_views?.should be_falsey
end
end
@@ -70,40 +70,40 @@ def example.controller
context "with no args" do
it "tells examples to render views" do
nested_group.render_views
- nested_group.new.render_views?.should be_true
+ nested_group.new.render_views?.should be_truthy
end
end
context "with true" do
it "tells examples to render views" do
nested_group.render_views true
- nested_group.new.render_views?.should be_true
+ nested_group.new.render_views?.should be_truthy
end
end
context "with false" do
it "tells examples not to render views" do
nested_group.render_views false
- nested_group.new.render_views?.should be_false
+ nested_group.new.render_views?.should be_falsey
end
end
it "leaves the parent group as/is" do
group.render_views
nested_group.render_views false
- group.new.render_views?.should be_true
+ group.new.render_views?.should be_truthy
end
it "overrides the value inherited from the parent group" do
group.render_views
nested_group.render_views false
- nested_group.new.render_views?.should be_false
+ nested_group.new.render_views?.should be_falsey
end
it "passes override to children" do
group.render_views
nested_group.render_views false
- nested_group.describe{}.new.render_views?.should be_false
+ nested_group.describe{}.new.render_views?.should be_falsey
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.