Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor: whitespace.

  • Loading branch information...
commit 3c5a40775ab93e6a9e24feec57b469dede2b7299 1 parent 0d8df34
@jnunemaker jnunemaker authored
Showing with 10 additions and 10 deletions.
  1. +4 −4 test/test_collection.rb
  2. +6 −6 test/test_query.rb
View
8 test/test_collection.rb
@@ -104,26 +104,26 @@ class CollectionTest < Test::Unit::TestCase
@collection.fields(:name).first(:id => 'john').keys.should == ['_id', 'name']
end
end
-
+
context "#reverse" do
should "work" do
@collection.sort(:age).reverse.all.should == [@steve, @john, @chris]
end
end
-
+
context "#where" do
should "work" do
@collection.where('this.name == "John"').all.should == [@john]
end
end
-
+
context "#[]" do
should "work" do
@collection.filter(:name => 'John')
@collection[:name].should == 'John'
end
end
-
+
context "#[]=" do
should "work" do
@collection[:name] = 'John'
View
12 test/test_query.rb
@@ -175,15 +175,15 @@ class QueryTest < Test::Unit::TestCase
should "update options (with hash)" do
Query.new.fields(:foo => 1, :bar => 0).options[:fields].should == {:foo => 1, :bar => 0}
end
-
+
should "normalize fields" do
Query.new.fields('foo, bar').options[:fields].should == %w(foo bar)
end
-
+
should "work with symbol" do
Query.new.fields(:foo).options[:fields].should == [:foo]
end
-
+
should "work with array of symbols" do
Query.new.fields(:foo, :bar).options[:fields].should == [:foo, :bar]
end
@@ -213,15 +213,15 @@ class QueryTest < Test::Unit::TestCase
should "work with symbol operators" do
Query.new.sort(:foo.asc, :bar.desc).options[:sort].should == [['foo', 1], ['bar', -1]]
end
-
+
should "work with string" do
Query.new.sort('foo, bar desc').options[:sort].should == [['foo', 1], ['bar', -1]]
end
-
+
should "work with just a symbol" do
Query.new.sort(:foo).options[:sort].should == [[:foo, 1]]
end
-
+
should "work with multiple symbols" do
Query.new.sort(:foo, :bar).options[:sort].should == [['foo', 1], ['bar', 1]]
end
Please sign in to comment.
Something went wrong with that request. Please try again.