amalgalite 1.1.2-x86-mingw32 → 1.4.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/CONTRIBUTING.md +49 -0
  2. data/{HISTORY.rdoc → HISTORY.md} +102 -73
  3. data/LICENSE +2 -2
  4. data/Manifest.txt +104 -0
  5. data/README.md +73 -0
  6. data/Rakefile +25 -0
  7. data/TODO.md +49 -0
  8. data/ext/amalgalite/{amalgalite3.c → c/amalgalite.c} +12 -12
  9. data/ext/amalgalite/{amalgalite3.h → c/amalgalite.h} +5 -5
  10. data/ext/amalgalite/{amalgalite3_blob.c → c/amalgalite_blob.c} +2 -2
  11. data/ext/amalgalite/{amalgalite3_constants.c → c/amalgalite_constants.c} +2 -2
  12. data/ext/amalgalite/{amalgalite3_database.c → c/amalgalite_database.c} +49 -21
  13. data/ext/amalgalite/{amalgalite3_requires_bootstrap.c → c/amalgalite_requires_bootstrap.c} +131 -58
  14. data/ext/amalgalite/{amalgalite3_statement.c → c/amalgalite_statement.c} +2 -2
  15. data/ext/amalgalite/{extconf.rb → c/extconf.rb} +6 -5
  16. data/ext/amalgalite/{gen_constants.rb → c/gen_constants.rb} +3 -3
  17. data/ext/amalgalite/c/notes.txt +134 -0
  18. data/ext/amalgalite/{sqlite3.c → c/sqlite3.c} +111793 -83396
  19. data/ext/amalgalite/{sqlite3.h → c/sqlite3.h} +1597 -383
  20. data/ext/amalgalite/{sqlite3_options.h → c/sqlite3_options.h} +0 -0
  21. data/ext/amalgalite/{sqlite3ext.h → c/sqlite3ext.h} +114 -17
  22. data/lib/amalgalite.rb +13 -6
  23. data/lib/amalgalite/1.9/amalgalite.so +0 -0
  24. data/lib/amalgalite/2.0/amalgalite.so +0 -0
  25. data/lib/amalgalite/2.1/amalgalite.so +0 -0
  26. data/lib/amalgalite/column.rb +7 -5
  27. data/lib/amalgalite/database.rb +18 -10
  28. data/lib/amalgalite/packer.rb +5 -2
  29. data/lib/amalgalite/requires.rb +47 -16
  30. data/lib/amalgalite/schema.rb +63 -36
  31. data/lib/amalgalite/sqlite3/version.rb +0 -1
  32. data/lib/amalgalite/statement.rb +7 -5
  33. data/lib/amalgalite/table.rb +9 -8
  34. data/lib/amalgalite/type_maps/default_map.rb +0 -1
  35. data/lib/amalgalite/type_maps/storage_map.rb +0 -2
  36. data/lib/amalgalite/type_maps/text_map.rb +0 -1
  37. data/lib/amalgalite/version.rb +3 -32
  38. data/spec/aggregate_spec.rb +1 -1
  39. data/spec/amalgalite_spec.rb +1 -1
  40. data/spec/blob_spec.rb +1 -1
  41. data/spec/boolean_spec.rb +2 -1
  42. data/spec/busy_handler.rb +1 -1
  43. data/spec/database_spec.rb +18 -13
  44. data/spec/default_map_spec.rb +1 -1
  45. data/spec/function_spec.rb +1 -1
  46. data/spec/integeration_spec.rb +2 -1
  47. data/spec/packer_spec.rb +4 -4
  48. data/spec/paths_spec.rb +1 -1
  49. data/spec/progress_handler_spec.rb +4 -5
  50. data/spec/requires_spec.rb +36 -2
  51. data/spec/rtree_spec.rb +6 -5
  52. data/spec/schema_spec.rb +28 -20
  53. data/spec/spec_helper.rb +7 -7
  54. data/spec/sqlite3/constants_spec.rb +1 -1
  55. data/spec/sqlite3/database_status_spec.rb +4 -4
  56. data/spec/sqlite3/status_spec.rb +5 -5
  57. data/spec/sqlite3/version_spec.rb +12 -12
  58. data/spec/sqlite3_spec.rb +3 -3
  59. data/spec/statement_spec.rb +3 -4
  60. data/spec/storage_map_spec.rb +1 -1
  61. data/spec/tap_spec.rb +4 -4
  62. data/spec/text_map_spec.rb +1 -1
  63. data/spec/type_map_spec.rb +1 -1
  64. data/spec/version_spec.rb +3 -10
  65. data/tasks/custom.rake +102 -0
  66. data/tasks/default.rake +247 -0
  67. data/tasks/extension.rake +28 -202
  68. data/tasks/this.rb +206 -0
  69. metadata +194 -236
  70. data/README.rdoc +0 -54
  71. data/gemspec.rb +0 -63
  72. data/lib/amalgalite/1.8/amalgalite3.so +0 -0
  73. data/lib/amalgalite/1.9/amalgalite3.so +0 -0
  74. data/tasks/announce.rake +0 -44
  75. data/tasks/config.rb +0 -107
  76. data/tasks/distribution.rake +0 -77
  77. data/tasks/documentation.rake +0 -36
  78. data/tasks/rspec.rake +0 -30
  79. data/tasks/utils.rb +0 -80
@@ -1,4 +1,4 @@
1
- $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
1
+ require 'spec_helper'
2
2
  require 'amalgalite/type_maps/default_map'
3
3
 
4
4
  describe Amalgalite::TypeMaps::DefaultMap do
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper.rb"))
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Scalar SQL Functions" do
4
4
 
@@ -1,4 +1,5 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper.rb"))
1
+ require 'spec_helper'
2
+
2
3
  require 'date'
3
4
  require 'time'
4
5
 
data/spec/packer_spec.rb CHANGED
@@ -1,6 +1,6 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper.rb"))
1
+ require 'spec_helper'
2
+
2
3
  require 'amalgalite/packer'
3
- require 'gemspec'
4
4
 
5
5
  describe "Amalgalite::Packer" do
6
6
  before( :each ) do
@@ -51,8 +51,8 @@ describe "Amalgalite::Packer" do
51
51
 
52
52
  it "has all the lib files in the amalgalite gem" do
53
53
  ro = Amalgalite::Packer.amalgalite_require_order
54
- glist = Amalgalite::GEM_SPEC.files.select { |l| l.index("lib/amalgalite") == 0 }
55
- glist.map! { |l| l.sub("lib/","") }
54
+ glist = IO.readlines("Manifest.txt").select { |l| l.index("lib/amalgalite") == 0 }
55
+ glist.map! { |l| l.strip.sub("lib/","") }
56
56
  (glist - ro).each do |l|
57
57
  l.should_not =~ /amalgalite/
58
58
  end
data/spec/paths_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper.rb"))
1
+ require 'spec_helper'
2
2
 
3
3
  describe Amalgalite::Paths do
4
4
  before(:each) do
@@ -1,4 +1,4 @@
1
- require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
1
+ require 'spec_helper'
2
2
 
3
3
  class PH < ::Amalgalite::ProgressHandler
4
4
  attr_reader :call_count
@@ -16,12 +16,11 @@ class PH < ::Amalgalite::ProgressHandler
16
16
  end
17
17
  end
18
18
 
19
- def query_thread( db )
20
- Thread.new( db ) do |db|
19
+ def query_thread( database )
20
+ Thread.new( database ) do |db|
21
21
  begin
22
22
  db.execute("select count(id) from country")
23
23
  rescue => e
24
- had_error = e
25
24
  Thread.current[:exception] = e
26
25
  end
27
26
  end
@@ -69,7 +68,7 @@ describe "Progress Handlers" do
69
68
  qt.join
70
69
  ph.call_count.should eql(25)
71
70
  qt[:exception].should be_instance_of( ::Amalgalite::SQLite3::Error )
72
- @iso_db.api.last_error_code.should == 9
71
+ @iso_db.api.last_error_code.should be == 9
73
72
  @iso_db.api.last_error_message.should =~ /interrupted/
74
73
  qt[:exception].message.should =~ /interrupted/
75
74
  end
@@ -1,5 +1,5 @@
1
- $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
2
- #require 'amalgalite/requires'
1
+ require 'spec_helper'
2
+ require 'amalgalite/requires'
3
3
 
4
4
  #describe Amalgalite::Requires do
5
5
  # it "#require_order has all files in 'lib' and no more" do
@@ -18,3 +18,37 @@ $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
18
18
  #end
19
19
 
20
20
 
21
+ describe Amalgalite::Requires do
22
+ it "can import to an in-memory database" do
23
+ sql = <<-SQL
24
+ CREATE TABLE rubylibs (
25
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
26
+ filename TEXT UNIQUE,
27
+ compressed BOOLEAN,
28
+ contents BLOB
29
+ );
30
+ INSERT INTO "rubylibs" VALUES(1, "application", "false", 'A=1');
31
+ SQL
32
+ r = Amalgalite::Requires.new(:dbfile_name => ":memory:")
33
+ r.import(sql)
34
+ r.file_contents( "application" ).should == "A=1"
35
+ end
36
+
37
+
38
+ it "gives equal instances for file databases" do
39
+ a = Amalgalite::Requires.new( :dbfile_name => SpecInfo.test_db )
40
+ b = Amalgalite::Requires.new( :dbfile_name => SpecInfo.test_db )
41
+
42
+ a.db_connection.should equal( b.db_connection )
43
+ end
44
+
45
+
46
+ it "gives separate instances for in-memory databases" do
47
+ a = Amalgalite::Requires.new( :dbfile_name => ":memory:" )
48
+ b = Amalgalite::Requires.new( :dbfile_name => ":memory:" )
49
+
50
+ a.db_connection.should_not equal(b.db_connection)
51
+ end
52
+
53
+
54
+ end
data/spec/rtree_spec.rb CHANGED
@@ -1,4 +1,5 @@
1
- require File.expand_path( File.join( File.dirname(__FILE__), 'spec_helper'))
1
+ require 'spec_helper'
2
+
2
3
  #
3
4
  # Example from http://sqlite.org/rtree.html
4
5
  #
@@ -37,9 +38,9 @@ describe "SQLite3 R*Tree extension" do
37
38
 
38
39
  it "queries normally" do
39
40
  r = @db.execute "SELECT * FROM demo_index WHERE id=1;"
40
- r.size.should == 1
41
+ r.size.should be == 1
41
42
  row = r.first
42
- row['id'].should == 1
43
+ row['id'].should be == 1
43
44
  end
44
45
 
45
46
  it "does a 'contained within' query" do
@@ -49,8 +50,8 @@ describe "SQLite3 R*Tree extension" do
49
50
  AND minY>=30.00 AND maxY<=30.44;
50
51
  sql
51
52
 
52
- r.size.should == 1
53
- r.first['id'].should == 1
53
+ r.size.should be == 1
54
+ r.first['id'].should be == 1
54
55
  end
55
56
 
56
57
  it "does an 'overlapping' query" do
data/spec/schema_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path( File.join( File.dirname(__FILE__), 'spec_helper'))
1
+ require 'spec_helper'
2
2
 
3
3
  require 'amalgalite'
4
4
  require 'amalgalite/schema'
@@ -15,7 +15,7 @@ describe Amalgalite::Schema do
15
15
  s = @iso_db.schema
16
16
  sql = "CREATE VIEW v1 AS SELECT c.name, c.two_letter, s.name, s.subdivision FROM country AS c JOIN subcountry AS s ON c.two_letter = s.country"
17
17
  @iso_db.execute( sql )
18
- s.dirty?.should == true
18
+ s.dirty?.should be == true
19
19
  @iso_db.schema.load_views
20
20
  @iso_db.schema.views.size.should eql(1)
21
21
  @iso_db.schema.views["v1"].sql.should eql(sql)
@@ -25,9 +25,9 @@ describe Amalgalite::Schema do
25
25
  s = @iso_db.schema
26
26
  sql = "CREATE TABLE t1( d1 default 't' )"
27
27
  @iso_db.execute( sql )
28
- s.dirty?.should == true
28
+ s.dirty?.should be == true
29
29
  tt = @iso_db.schema.tables['t1']
30
- tt.columns['d1'].default_value.should == "t"
30
+ tt.columns['d1'].default_value.should be == "t"
31
31
  end
32
32
 
33
33
  it "loads the tables and columns" do
@@ -56,23 +56,22 @@ describe Amalgalite::Schema do
56
56
  s = @iso_db.schema
57
57
  sql = "CREATE TABLE u( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , other text )"
58
58
  @iso_db.execute( sql )
59
- s.dirty?.should == true
59
+ s.dirty?.should be == true
60
60
  ut = @iso_db.schema.tables['u']
61
61
  ut.primary_key.should == [ ut.columns['id'] ]
62
62
  end
63
63
 
64
64
  it "knows the primary key of a temporary table" do
65
65
  @iso_db.execute "CREATE TEMPORARY TABLE tt( a, b INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, c )"
66
- tt = @iso_db.schema.load_table( 'tt' )
66
+ tt = @iso_db.schema.tables[ 'tt' ]
67
67
  tt.primary_key.should == [ tt.columns['b'] ]
68
-
69
68
  end
70
69
 
71
70
  it "knows what the primary key of a table is when it is a multiple column primary key" do
72
71
  sql = "CREATE TABLE m ( id1, id2, PRIMARY KEY (id2, id1) )"
73
72
  s = @iso_db.schema
74
73
  @iso_db.execute( sql )
75
- s.dirty?.should == true
74
+ s.dirty?.should be == true
76
75
  mt = @iso_db.schema.tables['m']
77
76
  mt.primary_key.should == [ mt.columns['id2'], mt.columns['id1'] ]
78
77
  end
@@ -93,31 +92,40 @@ describe Amalgalite::Schema do
93
92
 
94
93
  it "knows the schema is dirty when a table is created" do
95
94
  s = @iso_db.schema
96
- c = s.tables['country']
97
- s.dirty?.should == false
95
+ s.tables['country']
96
+ s.dirty?.should be == false
98
97
  @iso_db.execute( "create table x1( a, b )" )
99
- s.dirty?.should == true
98
+ s.dirty?.should be == true
100
99
  end
101
100
 
102
101
  it "knows the schema is dirty when a table is dropped" do
103
102
  s = @iso_db.schema
104
- c = s.tables['country']
103
+ s.tables['country']
105
104
  @iso_db.execute( "create table x1( a, b )" )
106
- s.dirty?.should == true
105
+ s.dirty?.should be == true
107
106
 
108
107
  @iso_db.schema.load_schema!
109
108
  s = @iso_db.schema
110
109
 
111
- s.dirty?.should == false
110
+ s.dirty?.should be == false
112
111
  @iso_db.execute("drop table x1")
113
- s.dirty?.should == true
112
+ s.dirty?.should be == true
114
113
  end
115
114
 
115
+ it "knows if a temporary table exists" do
116
+ @iso_db.execute "CREATE TEMPORARY TABLE tt(a,b,c)"
117
+ @iso_db.schema.tables.keys.include?('tt').should be == true
118
+ @iso_db.schema.tables['tt'].temporary?.should be == true
119
+ end
116
120
 
117
- it "can load the schema of a temporary table" do
118
- @iso_db.execute "CREATE TEMPORARY TABLE tt( a, b, c )"
119
- @iso_db.schema.tables['tt'].should be_nil
120
- @iso_db.schema.load_table('tt').should_not be_nil
121
- @iso_db.schema.tables['tt'].should be_temporary
121
+ it "sees that temporary tables shadow real tables" do
122
+ @iso_db.execute "CREATE TABLE tt(x)"
123
+ @iso_db.schema.tables['tt'].temporary?.should be == false
124
+ @iso_db.execute "CREATE TEMP TABLE tt(a,b,c)"
125
+ @iso_db.schema.tables['tt'].temporary?.should be == true
126
+ @iso_db.execute "DROP TABLE tt"
127
+ @iso_db.schema.tables['tt'].temporary?.should be == false
128
+ @iso_db.schema.tables['tt'].columns.size.should be == 1
122
129
  end
130
+
123
131
  end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,5 @@
1
- require 'rubygems'
2
1
  require 'rspec'
3
-
4
- $:.unshift File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
5
- require 'amalgalite/paths'
6
- $:.unshift Amalgalite::Paths.root_dir
2
+ require 'fileutils'
7
3
 
8
4
  require 'amalgalite'
9
5
  require Amalgalite::Paths.spec_path( "iso_3166_database.rb" )
@@ -19,12 +15,16 @@ class SpecInfo
19
15
  end
20
16
 
21
17
  def make_clone_iso_db
22
- new_path = make_master_iso_db.duplicate( 'testing' )
18
+ make_master_iso_db.duplicate( 'testing' )
23
19
  end
24
20
  end
25
21
  end
26
22
 
27
23
  RSpec.configure do |config|
24
+ config.expect_with :rspec do |c|
25
+ c.syntax = [:should, :expect]
26
+ end
27
+
28
28
  config.before(:all) do
29
29
  SpecInfo.make_master_iso_db
30
30
  end
@@ -36,7 +36,7 @@ RSpec.configure do |config|
36
36
  config.before( :each ) do
37
37
  @iso_db_path = SpecInfo.make_clone_iso_db
38
38
  @iso_db = Amalgalite::Database.new( @iso_db_path )
39
- @schema = IO.read( Amalgalite::Iso3166Database.schema_file )
39
+ @schema = IO.read( Amalgalite::Iso3166Database.schema_file )
40
40
  end
41
41
 
42
42
  config.after( :each ) do
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),%w[ .. spec_helper.rb ]))
1
+ require 'spec_helper'
2
2
 
3
3
  require 'amalgalite/sqlite3/constants'
4
4
 
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper.rb"))
1
+ require 'spec_helper'
2
2
  require 'amalgalite/sqlite3'
3
3
  require 'rbconfig'
4
4
 
@@ -18,14 +18,14 @@ describe "Amalgalite::SQLite3::Database::Status" do
18
18
 
19
19
 
20
20
  it "knows how much lookaside memory it has used" do
21
- @db.api.status.lookaside_used.highwater.should > 0
22
- @db.api.status.lookaside_used.current.should >= 0
21
+ @db.api.status.lookaside_used.highwater.should be > 0
22
+ @db.api.status.lookaside_used.current.should be >= 0
23
23
  end
24
24
 
25
25
  it "can reset the highwater value" do
26
26
  stat = @db.api.status.lookaside_used
27
27
  before = stat.highwater
28
- before.should > 0
28
+ before.should be > 0
29
29
 
30
30
  stat.reset!
31
31
  after = stat.highwater
@@ -1,20 +1,20 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper.rb"))
1
+ require 'spec_helper'
2
2
  require 'amalgalite/sqlite3'
3
3
  require 'rbconfig'
4
4
 
5
5
  describe "Amalgalite::SQLite3::Status" do
6
6
  it "knows how much memory it has used" do
7
- Amalgalite::SQLite3.status.memory_used.current.should >= 0
8
- Amalgalite::SQLite3.status.memory_used.highwater.should >= 0
7
+ Amalgalite::SQLite3.status.memory_used.current.should be >= 0
8
+ Amalgalite::SQLite3.status.memory_used.highwater.should be >= 0
9
9
  end
10
10
 
11
11
  it "can reset the highwater value" do
12
12
  before = Amalgalite::SQLite3.status.memory_used.highwater
13
- before.should > 0
13
+ before.should be > 0
14
14
 
15
15
  current = Amalgalite::SQLite3.status.memory_used.current
16
16
  Amalgalite::SQLite3.status.memory_used.reset!
17
- Amalgalite::SQLite3.status.memory_used.highwater.should == current
17
+ Amalgalite::SQLite3.status.memory_used.highwater.should be == current
18
18
 
19
19
  after = Amalgalite::SQLite3.status.memory_used.highwater
20
20
  after.should_not eql(before)
@@ -1,22 +1,22 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),"..","spec_helper.rb"))
1
+ require 'spec_helper'
2
2
  require 'amalgalite/sqlite3/version'
3
3
 
4
4
  describe "Amalgalite::SQLite3::Version" do
5
5
  it "should have the sqlite3 version" do
6
- Amalgalite::SQLite3::VERSION.should =~ /\d\.\d\.\d/
7
- Amalgalite::SQLite3::Version.to_s.should =~ /\d\.\d\.\d/
8
- Amalgalite::SQLite3::Version.runtime_version.should =~ /\d\.\d\.\d/
6
+ expect(Amalgalite::SQLite3::VERSION).to match(/\d\.\d\.\d/)
7
+ expect(Amalgalite::SQLite3::Version.to_s).to match( /\d\.\d\.\d/ )
8
+ expect(Amalgalite::SQLite3::Version.runtime_version).to match( /\d\.\d\.\d/ )
9
9
 
10
- Amalgalite::SQLite3::Version.to_i.should eql(3007005)
11
- Amalgalite::SQLite3::Version.runtime_version_number.should eql(3007005)
10
+ Amalgalite::SQLite3::Version.to_i.should eql(3008007)
11
+ Amalgalite::SQLite3::Version.runtime_version_number.should eql(3008007)
12
12
 
13
13
  Amalgalite::SQLite3::Version::MAJOR.should eql(3)
14
- Amalgalite::SQLite3::Version::MINOR.should eql(7)
15
- Amalgalite::SQLite3::Version::RELEASE.should eql(5)
16
- Amalgalite::SQLite3::Version.to_a.should have(3).items
14
+ Amalgalite::SQLite3::Version::MINOR.should eql(8)
15
+ Amalgalite::SQLite3::Version::RELEASE.should eql(7)
16
+ expect(Amalgalite::SQLite3::Version.to_a.size).to eql(3)
17
17
 
18
- Amalgalite::SQLite3::Version.compiled_version.should == "3.7.5"
19
- Amalgalite::SQLite3::Version.compiled_version_number.should == 3007005
20
- Amalgalite::SQLite3::Version.compiled_matches_runtime?.should == true
18
+ Amalgalite::SQLite3::Version.compiled_version.should be == "3.8.7.4"
19
+ Amalgalite::SQLite3::Version.compiled_version_number.should be == 3008007
20
+ Amalgalite::SQLite3::Version.compiled_matches_runtime?.should be == true
21
21
  end
22
22
  end
data/spec/sqlite3_spec.rb CHANGED
@@ -1,10 +1,10 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper.rb"))
1
+ require 'spec_helper'
2
2
  require 'amalgalite/sqlite3'
3
3
  require 'rbconfig'
4
4
 
5
5
  describe "Amalgalite::SQLite3" do
6
- it "is threadsafe is ruby is compiled with pthread support, in this case that is (#{Config::CONFIG['configure_args'].include?( "--enable-pthread" )})" do
7
- Amalgalite::SQLite3.threadsafe?.should eql(Config::CONFIG['configure_args'].include?( "--enable-pthread" ))
6
+ it "is threadsafe is ruby is compiled with pthread support, in this case that is (#{RbConfig::CONFIG['configure_args'].include?( "--enable-pthread" )})" do
7
+ Amalgalite::SQLite3.threadsafe?.should eql(RbConfig::CONFIG['configure_args'].include?( "--enable-pthread" ))
8
8
  end
9
9
 
10
10
  it "knows if an SQL statement is complete" do
@@ -1,4 +1,4 @@
1
- require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
1
+ require 'spec_helper'
2
2
 
3
3
  describe Amalgalite::Statement do
4
4
  before(:each) do
@@ -125,10 +125,9 @@ describe Amalgalite::Statement do
125
125
  end
126
126
 
127
127
  it "can execute a single sql command and say if there is remaining sql to execute" do
128
- db = Amalgalite::Database.new( SpecInfo.test_db )
129
128
  stmt = @db.prepare( @schema )
130
129
  stmt.execute
131
- stmt.remaining_sql.size.should > 0
130
+ stmt.remaining_sql.size.should be > 0
132
131
  stmt.close
133
132
  end
134
133
 
@@ -148,7 +147,7 @@ describe Amalgalite::Statement do
148
147
  db.execute( "create table t1(c1,c2,c3)" )
149
148
  db.execute("insert into t1(c1,c2,c3) values (1,2,'abc')")
150
149
  db.prepare( "select oid,* from t1" ) do |stmt|
151
- rows = stmt.execute
150
+ stmt.execute
152
151
  stmt.should be_using_rowid_column
153
152
  end
154
153
 
@@ -1,4 +1,4 @@
1
- require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
1
+ require 'spec_helper'
2
2
  require 'amalgalite/type_maps/storage_map'
3
3
 
4
4
  describe Amalgalite::TypeMaps::StorageMap do
data/spec/tap_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
1
+ require 'spec_helper'
2
2
 
3
3
  require 'amalgalite'
4
4
  require 'amalgalite/trace_tap'
@@ -34,11 +34,11 @@ describe Amalgalite::Taps::StringIO do
34
34
  end
35
35
 
36
36
  it "has a stdout tap" do
37
- s = ::Amalgalite::Taps::Stdout.new
37
+ ::Amalgalite::Taps::Stdout.new
38
38
  end
39
-
39
+
40
40
  it "has a stderr tap" do
41
- s = ::Amalgalite::Taps::Stderr.new
41
+ ::Amalgalite::Taps::Stderr.new
42
42
  end
43
43
  end
44
44