sequel 0.3.0 → 0.3.0.1
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/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/sequel/database.rb +3 -1
- data/spec/database_spec.rb +12 -2
- metadata +1 -1
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'fileutils'
|
|
6
6
|
include FileUtils
|
7
7
|
|
8
8
|
NAME = "sequel"
|
9
|
-
VERS = "0.3.0"
|
9
|
+
VERS = "0.3.0.1"
|
10
10
|
CLEAN.include ['**/.*.sw?', 'pkg/*', '.config', 'doc/*', 'coverage/*']
|
11
11
|
RDOC_OPTS = ['--quiet', '--title', "Sequel: Concise ORM for Ruby",
|
12
12
|
"--opname", "index.html",
|
data/lib/sequel/database.rb
CHANGED
data/spec/database_spec.rb
CHANGED
@@ -547,14 +547,24 @@ context "Database#fetch" do
|
|
547
547
|
sql.should == "select name from table where name = 'aman' or id in (3, 4, 7)"
|
548
548
|
end
|
549
549
|
|
550
|
-
specify "should return
|
551
|
-
@db.fetch('select * from xyz').should
|
550
|
+
specify "should return the dataset if no block is given" do
|
551
|
+
@db.fetch('select * from xyz').should be_a_kind_of(Sequel::Dataset)
|
552
552
|
|
553
553
|
@db.fetch('select a from b').map {|r| r[:sql]}.should == ['select a from b']
|
554
554
|
|
555
555
|
@db.fetch('select c from d').inject([]) {|m, r| m << r; m}.should == \
|
556
556
|
[{:sql => 'select c from d'}]
|
557
557
|
end
|
558
|
+
|
559
|
+
specify "should return a dataset that always uses the given sql for SELECTs" do
|
560
|
+
ds = @db.fetch('select * from xyz')
|
561
|
+
ds.select_sql.should == 'select * from xyz'
|
562
|
+
ds.sql.should == 'select * from xyz'
|
563
|
+
|
564
|
+
ds.filter! {:price < 100}
|
565
|
+
ds.select_sql.should == 'select * from xyz'
|
566
|
+
ds.sql.should == 'select * from xyz'
|
567
|
+
end
|
558
568
|
end
|
559
569
|
|
560
570
|
context "Database#[]" do
|