Skip to content

Commit

Permalink
Use rspec 2.99 beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurnn committed Nov 10, 2013
1 parent b91705b commit bdb6d06
Show file tree
Hide file tree
Showing 76 changed files with 505 additions and 507 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gemspec
gem "rake"

group :test do
gem "rspec", "~> 2.14"
gem "rspec", "= 2.99.0.beta1"

if ENV["CI"]
gem "coveralls", require: false
Expand Down
14 changes: 7 additions & 7 deletions spec/mongoid/attributes/nested_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@
end

it "runs the destroy callbacks" do
expect(pet.destroy_flag).to be_true
expect(pet.destroy_flag).to be_truthy
end
end
end
Expand Down Expand Up @@ -1136,11 +1136,11 @@
end

it "runs the first child create callbacks" do
expect(band.records.first.before_create_called).to be_true
expect(band.records.first.before_create_called).to be_truthy
end

it "runs the last child create callbacks" do
expect(band.records.last.before_create_called).to be_true
expect(band.records.last.before_create_called).to be_truthy
end
end
end
Expand Down Expand Up @@ -4334,11 +4334,11 @@
end

it "runs the before destroy callbacks" do
expect(service.before_destroy_called).to be_true
expect(service.before_destroy_called).to be_truthy
end

it "runs the after destroy callbacks" do
expect(service.after_destroy_called).to be_true
expect(service.after_destroy_called).to be_truthy
end

it "clears the delayed atomic pulls from the parent" do
Expand Down Expand Up @@ -4486,7 +4486,7 @@ class Address
end

it "runs the child's callbacks" do
expect(track.before_destroy_called).to be_true
expect(track.before_destroy_called).to be_truthy
end
end
end
Expand Down Expand Up @@ -4769,7 +4769,7 @@ class Address
end

it "returns false" do
expect(update).to be_false
expect(update).to be_falsey
end

it "does not update the child document" do
Expand Down
4 changes: 2 additions & 2 deletions spec/mongoid/attributes/readonly_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
end

it "sets subsequent readonly values" do
expect(person.terms).to be_true
expect(person.terms).to be_truthy
end

it "persists the first readonly value" do
expect(person.reload.title).to eq("sir")
end

it "persists subsequent readonly values" do
expect(person.reload.terms).to be_true
expect(person.reload.terms).to be_truthy
end
end

Expand Down
48 changes: 24 additions & 24 deletions spec/mongoid/attributes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
end

it "allows overwriting of the default value" do
expect(person.terms).to be_true
expect(person.terms).to be_truthy
end

it "returns the set value" do
Expand Down Expand Up @@ -333,7 +333,7 @@
end

it "returns true for respond_to?" do
expect(person.respond_to?(:testing)).to be_true
expect(person.respond_to?(:testing)).to be_truthy
end
end

Expand Down Expand Up @@ -431,7 +431,7 @@
end

it "casts booleans" do
expect(person[:terms]).to be_true
expect(person[:terms]).to be_truthy
end

it "sets empty strings to nil" do
Expand Down Expand Up @@ -580,7 +580,7 @@

it "returns the default value" do
expect(person.age).to eq(100)
expect(person.pets).to be_false
expect(person.pets).to be_falsey
end

end
Expand Down Expand Up @@ -669,7 +669,7 @@
context "when attribute does not exist" do

it "returns false" do
expect(person.attribute_present?(:owner_id)).to be_false
expect(person.attribute_present?(:owner_id)).to be_falsey
end
end

Expand All @@ -679,7 +679,7 @@
end

it "returns true" do
expect(person.attribute_present?(:owner_id)).to be_true
expect(person.attribute_present?(:owner_id)).to be_truthy
end
end
end
Expand All @@ -702,7 +702,7 @@
end

it "returns true" do
expect(person.attribute_present?(:age)).to be_true
expect(person.attribute_present?(:age)).to be_truthy
end
end
end
Expand All @@ -719,15 +719,15 @@

it "return true" do
person.terms = false
expect(person.attribute_present?(:terms)).to be_true
expect(person.attribute_present?(:terms)).to be_truthy
end
end

context "when the value is false" do

it "return true" do
person.terms = false
expect(person.attribute_present?(:terms)).to be_true
expect(person.attribute_present?(:terms)).to be_truthy
end
end
end
Expand All @@ -740,7 +740,7 @@
end

it "return false" do
expect(person.attribute_present?(:title)).to be_false
expect(person.attribute_present?(:title)).to be_falsey
end
end
end
Expand All @@ -756,22 +756,22 @@
context "when provided a symbol" do

it "returns true" do
expect(person.has_attribute?(:title)).to be_true
expect(person.has_attribute?(:title)).to be_truthy
end
end

context "when provided a string" do

it "returns true" do
expect(person.has_attribute?("title")).to be_true
expect(person.has_attribute?("title")).to be_truthy
end
end
end

context "when the key is not in the attributes" do

it "returns false" do
expect(person.has_attribute?(:employer_id)).to be_false
expect(person.has_attribute?(:employer_id)).to be_falsey
end
end
end
Expand All @@ -785,15 +785,15 @@
context "before the attribute has been assigned" do

it "returns false" do
expect(person.has_attribute_before_type_cast?(:age)).to be_false
expect(person.has_attribute_before_type_cast?(:age)).to be_falsey
end
end

context "after the attribute has been assigned" do

it "returns true" do
person.age = 'old'
expect(person.has_attribute_before_type_cast?(:age)).to be_true
expect(person.has_attribute_before_type_cast?(:age)).to be_truthy
end
end
end
Expand All @@ -815,7 +815,7 @@
end

it "removes the key from the attributes hash" do
expect(person.has_attribute?(:title)).to be_false
expect(person.has_attribute?(:title)).to be_falsey
end

context "when saving after the removal" do
Expand All @@ -825,7 +825,7 @@
end

it "persists the removal" do
expect(person.reload.has_attribute?(:title)).to be_false
expect(person.reload.has_attribute?(:title)).to be_falsey
end
end
end
Expand All @@ -850,7 +850,7 @@
end

it "removes the key from the attributes hash" do
expect(person.pet.has_attribute?(:name)).to be_false
expect(person.pet.has_attribute?(:name)).to be_falsey
end

context "when saving after the removal" do
Expand All @@ -860,7 +860,7 @@
end

it "persists the removal" do
expect(person.reload.pet.has_attribute?(:name)).to be_false
expect(person.reload.pet.has_attribute?(:name)).to be_falsey
end
end

Expand Down Expand Up @@ -1015,7 +1015,7 @@
end

it "allows overwriting of the default value" do
expect(person.terms).to be_true
expect(person.terms).to be_truthy
end
end

Expand Down Expand Up @@ -1320,11 +1320,11 @@
end

it "aliases the existance check" do
expect(product.cost?).to be_true
expect(product.cost?).to be_truthy
end

it "aliases *_changed?" do
expect(product.cost_changed?).to be_true
expect(product.cost_changed?).to be_truthy
end

it "aliases *_change" do
Expand Down Expand Up @@ -1361,11 +1361,11 @@
end

it "aliases the existance check" do
expect(product.price?).to be_true
expect(product.price?).to be_truthy
end

it "aliases *_changed?" do
expect(product.price_changed?).to be_true
expect(product.price_changed?).to be_truthy
end

it "aliases *_change" do
Expand Down
28 changes: 14 additions & 14 deletions spec/mongoid/changeable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@
end

it "returns true" do
expect(person.send(:attribute_changed?, "title")).to be_true
expect(person.send(:attribute_changed?, "title")).to be_truthy
end

it "allows access via (attribute)_changed?" do
expect(person.title_changed?).to be_true
expect(person.title_changed?).to be_truthy
end

context "when the field is aliased" do
Expand All @@ -370,11 +370,11 @@
end

it "returns true" do
expect(person.send(:attribute_changed?, "test")).to be_true
expect(person.send(:attribute_changed?, "test")).to be_truthy
end

it "allows access via (attribute)_changed?" do
expect(person.test_changed?).to be_true
expect(person.test_changed?).to be_truthy
end
end
end
Expand All @@ -390,11 +390,11 @@
end

it "returns true" do
expect(person.send(:attribute_changed?, "pets")).to be_true
expect(person.send(:attribute_changed?, "pets")).to be_truthy
end

it "allows access via (attribute)_changed?" do
expect(person.pets_changed?).to be_true
expect(person.pets_changed?).to be_truthy
end
end

Expand All @@ -405,7 +405,7 @@
end

it "returns false" do
expect(person.send(:attribute_changed?, "title")).to be_false
expect(person.send(:attribute_changed?, "title")).to be_falsey
end
end

Expand All @@ -420,7 +420,7 @@
end

it "returns true" do
expect(person.send(:attribute_changed?, "pets")).to be_true
expect(person.send(:attribute_changed?, "pets")).to be_truthy
end
end

Expand All @@ -431,7 +431,7 @@
end

it "returns false" do
expect(person.send(:attribute_changed?, "pets")).to be_false
expect(person.send(:attribute_changed?, "pets")).to be_falsey
end
end
end
Expand Down Expand Up @@ -552,11 +552,11 @@
end

it "returns the default value" do
expect(person.send(:attribute_was, "pets")).to be_false
expect(person.send(:attribute_was, "pets")).to be_falsey
end

it "allows access via (attribute)_was" do
expect(person.pets_was).to be_false
expect(person.pets_was).to be_falsey
end
end

Expand All @@ -578,7 +578,7 @@
end

it "returns the default value" do
expect(person.send(:attribute_was, "pets")).to be_false
expect(person.send(:attribute_was, "pets")).to be_falsey
end
end
end
Expand Down Expand Up @@ -1183,7 +1183,7 @@
end

it "defines a _changed? method" do
expect(document.updated_at_changed?).to be_false
expect(document.updated_at_changed?).to be_falsey
end

it "defines a _changes method" do
Expand Down Expand Up @@ -1393,7 +1393,7 @@
end

it "marks the field as changed" do
expect(person.title_changed?).to be_true
expect(person.title_changed?).to be_truthy
end

it "stores previous field values" do
Expand Down
Loading

0 comments on commit bdb6d06

Please sign in to comment.