Permalink
Browse files

Remove old unused tests

  • Loading branch information...
1 parent 2137d10 commit 0a39d33747a090fb60094f2ab385f1e8ba72a324 @nicksieger nicksieger committed Jul 1, 2010
@@ -1,14 +0,0 @@
-require 'test/minirunit'
-RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
-require 'active_record'
-
-connspec = ActiveRecord::Base.establish_connection(
- :adapter => 'jdbc',
- :driver => 'com.mysql.jdbc.Driver',
- :url => 'jdbc:mysql://localhost:3306/test',
- :username => 'rlsmgr',
- :password => ''
-)
-
-puts "#{connspec}"
-puts "#{ActiveRecord::Base.connection}"
View
@@ -1,73 +0,0 @@
-
-require 'minirunit'
-
-config = {
- :adapter => 'jdbc',
- :username => 'sa',
- :password => '',
- :driver => 'org.h2.Driver',
- :url => 'jdbc:h2:test.db'
-}
-RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
-
-require 'active_record'
-
-ActiveRecord::Base.establish_connection(config)
-require 'logger'
-ActiveRecord::Base.logger = Logger.new($stdout)
-ActiveRecord::Base.logger.level = Logger::DEBUG
-
-class CreateEntries < ActiveRecord::Migration
- def self.up
- create_table "entries", :force => true do |t|
- t.column :title, :string, :limit => 100
- t.column :updated_on, :datetime
- t.column :content, :text
- end
- end
-
- def self.down
- drop_table "entries"
- end
-end
-
-CreateEntries.up
-
-test_ok ActiveRecord::Base.connection.tables.include?('entries')
-
-class Entry < ActiveRecord::Base
-end
-
-Entry.delete_all
-
-test_equal 0, Entry.count
-
-TITLE = "First post!"
-CONTENT = "Hello from JRuby on Rails!"
-NEW_TITLE = "First post updated title"
-
-post = Entry.new
-post.title = TITLE
-post.content = CONTENT
-post.save
-
-test_equal 1, Entry.count
-
-post = Entry.find(:first)
-test_equal TITLE, post.title
-test_equal CONTENT, post.content
-
-post.title = NEW_TITLE
-post.save
-
-post = Entry.find(:first)
-test_equal NEW_TITLE, post.title
-
-post.destroy
-
-test_equal 0, Entry.count
-
-CreateEntries.down
-
-# Clean up hsqldb when done
-Dir['test.db*'].each {|f| File.delete(f)}
@@ -1,73 +0,0 @@
-
-require 'minirunit'
-
-config = {
- :adapter => 'jdbc',
- :username => 'sa',
- :password => '',
- :driver => 'org.hsqldb.jdbcDriver',
- :url => 'jdbc:hsqldb:test.db'
-}
-RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
-
-require 'active_record'
-
-ActiveRecord::Base.establish_connection(config)
-require 'logger'
-ActiveRecord::Base.logger = Logger.new($stdout)
-ActiveRecord::Base.logger.level = Logger::DEBUG
-
-class CreateEntries < ActiveRecord::Migration
- def self.up
- create_table "entries", :force => true do |t|
- t.column :title, :string, :limit => 100
- t.column :updated_on, :datetime
- t.column :content, :text
- end
- end
-
- def self.down
- drop_table "entries"
- end
-end
-
-CreateEntries.up
-
-test_ok ActiveRecord::Base.connection.tables.include?('entries')
-
-class Entry < ActiveRecord::Base
-end
-
-Entry.delete_all
-
-test_equal 0, Entry.count
-
-TITLE = "First post!"
-CONTENT = "Hello from JRuby on Rails!"
-NEW_TITLE = "First post updated title"
-
-post = Entry.new
-post.title = TITLE
-post.content = CONTENT
-post.save
-
-test_equal 1, Entry.count
-
-post = Entry.find(:first)
-test_equal TITLE, post.title
-test_equal CONTENT, post.content
-
-post.title = NEW_TITLE
-post.save
-
-post = Entry.find(:first)
-test_equal NEW_TITLE, post.title
-
-post.destroy
-
-test_equal 0, Entry.count
-
-CreateEntries.down
-
-# Clean up hsqldb when done
-Dir['test.db*'].each {|f| File.delete(f)}
@@ -1,3 +0,0 @@
-require 'test/minirunit'
-RAILS_CONNECTION_ADAPTERS = ['abstract']
-test_load 'active_record'
@@ -1,83 +0,0 @@
-# To run this script, run the following in a mysql instance:
-#
-# drop database if exists weblog_development;
-# create database weblog_development;
-# grant all on weblog_development.* to blog@localhost;
-
-require 'minirunit'
-
-config = {
- :username => 'blog',
- :password => ''
-}
-
-if RUBY_PLATFORM =~ /java/
- RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
- config.update({
- :adapter => 'jdbc',
- :driver => 'com.mysql.jdbc.Driver',
- :url => 'jdbc:mysql://localhost:3306/weblog_development',
- })
-else
- config.update({
- :adapter => 'mysql',
- :database => 'weblog_development',
- :host => 'localhost'
- })
-end
-
-require 'active_record'
-
-ActiveRecord::Base.establish_connection(config)
-
-class CreateEntries < ActiveRecord::Migration
- def self.up
- create_table "entries", :force => true do |t|
- t.column :title, :string, :limit => 100
- t.column :updated_on, :datetime
- t.column :content, :text
- end
- end
-
- def self.down
- drop_table "entries"
- end
-end
-
-CreateEntries.up
-
-test_ok ActiveRecord::Base.connection.tables.include?('entries')
-
-class Entry < ActiveRecord::Base
-end
-
-Entry.delete_all
-
-test_equal 0, Entry.count
-
-TITLE = "First post!"
-CONTENT = "Hello from JRuby on Rails!"
-NEW_TITLE = "First post updated title"
-
-post = Entry.new
-post.title = TITLE
-post.content = CONTENT
-post.save
-
-test_equal 1, Entry.count
-
-post = Entry.find(:first)
-test_equal TITLE, post.title
-test_equal CONTENT, post.content
-
-post.title = NEW_TITLE
-post.save
-
-post = Entry.find(:first)
-test_equal NEW_TITLE, post.title
-
-post.destroy
-
-test_equal 0, Entry.count
-
-CreateEntries.down
@@ -1,24 +0,0 @@
-
-require 'test/minirunit'
-RAILS_CONNECTION_ADAPTERS = ['abstract', 'jdbc']
-require 'active_record'
-
-connspec = ActiveRecord::Base.establish_connection(
- :adapter => 'jdbc',
- :driver => 'com.mysql.jdbc.Driver',
- :url => 'jdbc:mysql://localhost:3306/weblog_development',
- :username => 'blog',
- :password => ''
-)
-
-connection = ActiveRecord::Base.connection
-
-results = connection.execute "select * from entries"
-
-test_equal results.length, 1
-
-row = results.first
-test_equal 'First post', row['title']
-test_equal 'First post d00d!', row['content']
-
-puts row.inspect

0 comments on commit 0a39d33

Please sign in to comment.