Skip to content

Instantly share code, notes, and snippets.

@myabc
Created January 8, 2009 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myabc/44713 to your computer and use it in GitHub Desktop.
Save myabc/44713 to your computer and use it in GitHub Desktop.
[alexbcoles@mondiale do_mysql (jdbc)]$ jruby -S rake spec
(in /Users/alexbcoles/git-repos/do/do_mysql)
/usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009.
mkdir -p pkg/classes
DataObjects::Mysql
- should expose the proper DataObjects classes
- should connect successfully via TCP
- should be able to send queries asynchronously in parallel
- should return the current character set
- should support changing the character set (PENDING: JDBC API does not provide an easy way to get the current character set)
- should raise an error when opened with an invalid server uri
DataObjects::Mysql::Connection
- should raise an error when attempting to execute a bad query
- should raise an error when executing a bad reader
- should not raise a connection closed error after an incorrect query
- should not raise a connection closed error after an incorrect reader
DataObjects::Mysql::Reader
- should raise an error when you pass too many or too few types for the expected result set
- shouldn't raise an error when you pass NO types for the expected result set
JDBC TypeName INTEGER
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName INTEGER
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName CHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName BLOB
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName MEDIUMBLOB
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName LONGBLOB
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName TINYINT
JDBC Metadata scale 0
Ruby Type TrueClass
JDBC TypeName SMALLINT
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName MEDIUMINT
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName BIGINT
JDBC Metadata scale 0
Ruby Type Bignum
JDBC TypeName FLOAT
JDBC Metadata scale 31
Ruby Type String
JDBC TypeName DOUBLE
JDBC Metadata scale 2
Ruby Type Float
JDBC TypeName DECIMAL
JDBC Metadata scale 2
Ruby Type BigDecimal
JDBC TypeName DATE
JDBC Metadata scale 0
Ruby Type Date
JDBC TypeName DATETIME
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName CHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName INTEGER
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName CHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName BLOB
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName MEDIUMBLOB
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName LONGBLOB
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName TINYINT
JDBC Metadata scale 0
Ruby Type TrueClass
JDBC TypeName SMALLINT
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName MEDIUMINT
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName BIGINT
JDBC Metadata scale 0
Ruby Type Bignum
JDBC TypeName FLOAT
JDBC Metadata scale 31
Ruby Type String
JDBC TypeName DOUBLE
JDBC Metadata scale 2
Ruby Type Float
JDBC TypeName DECIMAL
JDBC Metadata scale 2
Ruby Type BigDecimal
JDBC TypeName DATE
JDBC Metadata scale 0
Ruby Type Date
JDBC TypeName DATETIME
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName CHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName INTEGER
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName INTEGER
JDBC Metadata scale 0
Ruby Type Fixnum
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type DateTime
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName VARCHAR
JDBC Metadata scale 0
Ruby Type String
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type Time
- should return the proper number of fields
- should raise an exception if .values is called after reading all available rows
- should fetch the proper number of rows
- should contain tainted strings
- should return DB nulls as nil
- should not convert empty strings to null
DataObjects::Mysql::Reader Date, Time, and DateTime
- should return nil when the time is 0
JDBC TypeName TIMESTAMP
JDBC Metadata scale 0
Ruby Type DateTime
- should return DateTimes using the current locale's Time Zone
- should return 2009-01-08T01:44:16-11:00 offset to the current locale's Time Zone if they were inserted using a different timezone (PENDING: We don't support non-local date input yet)
- should return 2009-01-08T03:54:16-08:50 offset to the current locale's Time Zone if they were inserted using a different timezone (PENDING: We don't support non-local date input yet)
- should return 2009-01-08T04:44:16-08:00 offset to the current locale's Time Zone if they were inserted using a different timezone (PENDING: We don't support non-local date input yet)
- should return 2009-01-08T15:44:16+03:00 offset to the current locale's Time Zone if they were inserted using a different timezone (PENDING: We don't support non-local date input yet)
- should return 2009-01-08T18:14:16+05:30 offset to the current locale's Time Zone if they were inserted using a different timezone (PENDING: We don't support non-local date input yet)
DataObjects::Mysql::Reader executing a non-query
- should return a Result
- should be able to determine the affected_rows
- should yield the last inserted id
- should be able to determine the affected_rows (FAILED - 1)
- should raise an error when executing an invalid query
DataObjects::Mysql::Command Executing a Reader
- should log reader queries when the level is Debug (0)
- shouldn't log reader queries when the level isn't Debug (0)
DataObjects::Mysql::Command Executing a Non-Query
- should log non-query statements when the level is Debug (0)
- shouldn't log non-query statements when the level isn't Debug (0)
DataObjects::Mysql::Transaction
- should execute "XA START 'id'" on #begin
- should execute "XA COMMIT 'id'" on #commit
- should execute ["XA END 'id'", "XA ROLLBACK 'id'"] on #rollback
- should execute "XA ROLLBACK 'id'" on #rollback_prepared
- should execute ["XA END 'id'", "XA PREPARE 'id'"] on #prepare
Pending:
DataObjects::Mysql should support changing the character set (JDBC API does not provide an easy way to get the current character set)
Called from /usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/example_methods.rb:81:in `instance_eval'
DataObjects::Mysql::Reader Date, Time, and DateTime should return 2009-01-08T01:44:16-11:00 offset to the current locale's Time Zone if they were inserted using a different timezone (We don't support non-local date input yet)
Called from /usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/example_methods.rb:81:in `instance_eval'
DataObjects::Mysql::Reader Date, Time, and DateTime should return 2009-01-08T03:54:16-08:50 offset to the current locale's Time Zone if they were inserted using a different timezone (We don't support non-local date input yet)
Called from /usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/example_methods.rb:81:in `instance_eval'
DataObjects::Mysql::Reader Date, Time, and DateTime should return 2009-01-08T04:44:16-08:00 offset to the current locale's Time Zone if they were inserted using a different timezone (We don't support non-local date input yet)
Called from /usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/example_methods.rb:81:in `instance_eval'
DataObjects::Mysql::Reader Date, Time, and DateTime should return 2009-01-08T15:44:16+03:00 offset to the current locale's Time Zone if they were inserted using a different timezone (We don't support non-local date input yet)
Called from /usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/example_methods.rb:81:in `instance_eval'
DataObjects::Mysql::Reader Date, Time, and DateTime should return 2009-01-08T18:14:16+05:30 offset to the current locale's Time Zone if they were inserted using a different timezone (We don't support non-local date input yet)
Called from /usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/example_methods.rb:81:in `instance_eval'
1)
'DataObjects::Mysql::Reader executing a non-query should be able to determine the affected_rows' FAILED
expected: 2,
got: 1 (using ==)
spec/integration/do_mysql_spec.rb:301:
Finished in 5.54791 seconds
39 examples, 1 failure, 6 pending
rake aborted!
Command /usr/local/jruby-1.1.5/bin/jruby -I"/usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib" "/usr/local/jruby-1.1.5/lib/ruby/gems/1.8/gems/rspec-1.1.11/bin/spec" "spec/integration/do_mysql_spec.rb" "spec/integration/logging_spec.rb" "spec/integration/quoting_spec.rb" "spec/unit/transaction_spec.rb" --format specdoc --colour --loadby random failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment