johnbender-rquery 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +14 -29
- data/lib/rquery.rb +7 -13
- data/lib/rquery/active_record/base.rb +9 -20
- data/lib/rquery/adapters/sqlite.rb +1 -1
- data/lib/rquery/attribute_collection.rb +25 -3
- data/lib/rquery/operation_collector.rb +175 -0
- data/rakefile.rb +2 -1
- data/spec/active_record_base_spec_attribute_collection.rb +41 -62
- data/spec/or_and_operations_spec.rb +11 -11
- data/spec/sqlite_adapter_spec.rb +1 -1
- metadata +7 -12
- data/examples/user.rb +0 -49
- data/lib/rquery/attribute.rb +0 -14
- data/lib/rquery/declarations.rb +0 -34
- data/lib/rquery/serializers.rb +0 -184
- data/spec/active_record_base_spec_symbols.rb +0 -214
- data/spec/declarations_spec.rb +0 -23
- data/spec/serializers_spec.rb +0 -34
data/spec/declarations_spec.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + "/../lib/rquery.rb")
|
3
|
-
|
4
|
-
describe RQuery::Declarations do
|
5
|
-
|
6
|
-
before(:all) do
|
7
|
-
RQuery.adapter = RQuery::Adapters::Sqlite
|
8
|
-
end
|
9
|
-
|
10
|
-
after(:each) do
|
11
|
-
RQuery::Serializers::Operations.clear
|
12
|
-
end
|
13
|
-
|
14
|
-
it "any symbol should respond to is, is_not, in, between, from, and contains methods" do
|
15
|
-
:foo.respond_to?(:is).should == true
|
16
|
-
:foo.respond_to?(:is_not).should == true
|
17
|
-
:foo.respond_to?(:in).should == true
|
18
|
-
:foo.respond_to?(:from).should == true
|
19
|
-
:foo.respond_to?(:between).should == true
|
20
|
-
:foo.respond_to?(:from).should == true
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
data/spec/serializers_spec.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + "/../lib/rquery.rb")
|
3
|
-
|
4
|
-
describe RQuery::Serializers do
|
5
|
-
|
6
|
-
before(:all) do
|
7
|
-
RQuery.use_symbols
|
8
|
-
end
|
9
|
-
|
10
|
-
it "Object.is should define ==, <, <=, >, >=, in, and between" do
|
11
|
-
:foo.is.respond_to?(:==).should == true
|
12
|
-
:foo.is.respond_to?(:<).should == true
|
13
|
-
:foo.is.respond_to?(:<=).should == true
|
14
|
-
:foo.is.respond_to?(:>).should == true
|
15
|
-
:foo.is.respond_to?(:>=).should == true
|
16
|
-
:foo.is.respond_to?(:in).should == true
|
17
|
-
:foo.is.respond_to?(:between).should == true
|
18
|
-
end
|
19
|
-
|
20
|
-
it "Object.is_not should define == and in" do
|
21
|
-
:foo.is_not.respond_to?(:==).should == true
|
22
|
-
:foo.is_not.respond_to?(:in).should == true
|
23
|
-
:foo.is_not.respond_to?(:between).should == true
|
24
|
-
end
|
25
|
-
|
26
|
-
it "Object.is_not should not redefine <, <=, >, >= in the same way that .is did" do
|
27
|
-
lambda {:foo.is_not.send(:<)}.should raise_error(ArgumentError)
|
28
|
-
lambda {:foo.is_not.send(:<=)}.should raise_error(ArgumentError)
|
29
|
-
lambda {:foo.is_not.send(:>)}.should raise_error(ArgumentError)
|
30
|
-
lambda {:foo.is_not.send(:>=)}.should raise_error(ArgumentError)
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
end
|