Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix all the ruby warnings when VERBOSE set to true.

  • Loading branch information...
commit 8f7000f4481a854810ac714e8257227305df5abb 1 parent 96989ef
@cyx cyx authored
View
10 test/filtering.rb
@@ -52,7 +52,7 @@ class User < Ohm::Model
end
test "#except" do |john, jane|
- out = User.create(:status => "inactive", :lname => "Doe")
+ User.create(:status => "inactive", :lname => "Doe")
res = User.find(:lname => "Doe").except(:status => "inactive")
@@ -80,8 +80,8 @@ class User < Ohm::Model
end
test "#union" do |john, jane|
+ User.create(:status => "super", :lname => "Doe")
included = User.create(:status => "inactive", :lname => "Doe")
- excluded = User.create(:status => "super", :lname => "Doe")
res = User.find(:status => "active").union(:status => "inactive")
@@ -112,9 +112,9 @@ class Author < Ohm::Model
book1 = Book.create
book2 = Book.create
- auth1 = Author.create(:book => book1, :mood => "happy")
- auth2 = Author.create(:book => book1, :mood => "sad")
- auth3 = Author.create(:book => book2, :mood => "sad")
+ Author.create(:book => book1, :mood => "happy")
+ Author.create(:book => book1, :mood => "sad")
+ Author.create(:book => book2, :mood => "sad")
[book1, book2]
end
View
2  test/helper.rb
@@ -15,7 +15,7 @@ def silence_warnings
yield
ensure
$VERBOSE = original_verbose
-end
+end unless defined?(silence_warnings)
$VERBOSE = true
View
2  test/model.rb
@@ -70,7 +70,7 @@ def _initialize_id
class Foo < Ohm::Model
end
- foo = Foo.create
+ Foo.create
end
test "counters are cleaned up during deletion" do
View
2  test/validations.rb
@@ -103,7 +103,7 @@ def event.validate
# An existing model with a valid name
scope do
setup do
- event = Event.create(:name => "original")
+ Event.create(:name => "original")
end
# That has the name changed
Please sign in to comment.
Something went wrong with that request. Please try again.