diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-24 16:27:30 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-24 16:27:30 -0700 |
commit | ecb0a77c90142e8bb4eb64b1dd2c32de65d56004 (patch) | |
tree | 622376efe7b13d9a7b1467c3f77729a38464c297 /spec/support | |
parent | c21fcdcf837f43ae61f2be7592d8aab001c51b25 (diff) | |
download | rails-ecb0a77c90142e8bb4eb64b1dd2c32de65d56004.tar.gz rails-ecb0a77c90142e8bb4eb64b1dd2c32de65d56004.tar.bz2 rails-ecb0a77c90142e8bb4eb64b1dd2c32de65d56004.zip |
removing more unused files
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/connections/mysql_connection.rb | 14 | ||||
-rw-r--r-- | spec/support/connections/oracle_connection.rb | 17 | ||||
-rw-r--r-- | spec/support/connections/postgresql_connection.rb | 13 | ||||
-rw-r--r-- | spec/support/connections/sqlite3_connection.rb | 24 | ||||
-rw-r--r-- | spec/support/matchers/disambiguate_attributes.rb | 28 | ||||
-rw-r--r-- | spec/support/matchers/hash_the_same_as.rb | 26 | ||||
-rw-r--r-- | spec/support/matchers/have_rows.rb | 18 |
7 files changed, 0 insertions, 140 deletions
diff --git a/spec/support/connections/mysql_connection.rb b/spec/support/connections/mysql_connection.rb deleted file mode 100644 index c924c27080..0000000000 --- a/spec/support/connections/mysql_connection.rb +++ /dev/null @@ -1,14 +0,0 @@ -puts "Using native MySQL" -require "active_record" -require 'logger' - -ENV['ADAPTER'] = 'mysql' - -ActiveRecord::Base.configurations = { - 'unit' => { - :adapter => 'mysql', - :username => 'root', - :encoding => 'utf8', - :database => 'arel_unit', - } -} diff --git a/spec/support/connections/oracle_connection.rb b/spec/support/connections/oracle_connection.rb deleted file mode 100644 index 309d127071..0000000000 --- a/spec/support/connections/oracle_connection.rb +++ /dev/null @@ -1,17 +0,0 @@ -puts "Using native Oracle" -require "active_record" -require 'logger' - -ENV['ADAPTER'] = 'oracle' - -# Prepend oracle_enhanced local development directory in front of load path -$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../oracle-enhanced/lib" - -ActiveRecord::Base.configurations = { - 'unit' => { - :adapter => 'oracle_enhanced', - :username => 'arel_unit', - :password => 'arel_unit', - :database => 'orcl', - } -} diff --git a/spec/support/connections/postgresql_connection.rb b/spec/support/connections/postgresql_connection.rb deleted file mode 100644 index 692533d10d..0000000000 --- a/spec/support/connections/postgresql_connection.rb +++ /dev/null @@ -1,13 +0,0 @@ -puts "Using native PostgreSQL" -require "active_record" -require 'logger' - -ENV['ADAPTER'] = 'postgresql' - -ActiveRecord::Base.configurations = { - 'unit' => { - :adapter => 'postgresql', - :encoding => 'utf8', - :database => 'arel_unit', - } -} diff --git a/spec/support/connections/sqlite3_connection.rb b/spec/support/connections/sqlite3_connection.rb deleted file mode 100644 index 4c8627c795..0000000000 --- a/spec/support/connections/sqlite3_connection.rb +++ /dev/null @@ -1,24 +0,0 @@ -puts "Using native SQLite3" -require "active_record" -require 'logger' - -ENV['ADAPTER'] = 'sqlite3' - -db_file = "spec/support/fixtures/fixture_database.sqlite3" - -ActiveRecord::Base.configurations = { - "unit" => { - :adapter => 'sqlite3', - :database => db_file, - :timeout => 5000 - } -} - -unless File.exist?(db_file) - puts "SQLite3 database not found at #{db_file}. Rebuilding it." - require 'fileutils' - FileUtils.mkdir_p(File.dirname(db_file)) - sqlite_command = %Q{sqlite3 "#{db_file}" "create table a (a integer); drop table a;"} - puts "Executing '#{sqlite_command}'" - raise "Seems that there is no sqlite3 executable available" unless system(sqlite_command) -end diff --git a/spec/support/matchers/disambiguate_attributes.rb b/spec/support/matchers/disambiguate_attributes.rb deleted file mode 100644 index cec5924ca1..0000000000 --- a/spec/support/matchers/disambiguate_attributes.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Matchers - class DisambiguateAttributes - def initialize(attributes) - @attributes = attributes - end - - def matches?(actual) - @actual = actual - attribute1, attribute2 = @attributes - @actual[attribute1].descends_from?(attribute1) && - !@actual[attribute1].descends_from?(attribute2) && - @actual[attribute2].descends_from?(attribute2) - end - - def failure_message - "" - # "expected #{@actual} to disambiguate its attributes" - end - - def negative_failure_message - "expected #{@actual} to not disambiguate its attributes" - end - end - - def disambiguate_attributes(*attributes) - DisambiguateAttributes.new(attributes) - end -end diff --git a/spec/support/matchers/hash_the_same_as.rb b/spec/support/matchers/hash_the_same_as.rb deleted file mode 100644 index ed00d37f28..0000000000 --- a/spec/support/matchers/hash_the_same_as.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Matchers - class HashTheSameAs - def initialize(expected) - @expected = expected - end - - def matches?(actual) - @actual = actual - hash = {} - hash[@expected] = :some_arbitrary_value - hash[@actual] == :some_arbitrary_value - end - - def failure_message - "expected #{@actual} to hash the same as #{@expected}; they must be `eql?` and have the same `#hash` value" - end - - def negative_failure_message - "expected #{@actual} to hash differently than #{@expected}; they must not be `eql?` or have a differing `#hash` values" - end - end - - def hash_the_same_as(expected) - HashTheSameAs.new(expected) - end -end diff --git a/spec/support/matchers/have_rows.rb b/spec/support/matchers/have_rows.rb deleted file mode 100644 index e476d25f4f..0000000000 --- a/spec/support/matchers/have_rows.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Matchers - def have_rows(expected) - simple_matcher "have rows" do |given, matcher| - found, got, expected = [], [], expected.map { |r| r.tuple } - given.each do |row| - got << row.tuple - found << expected.find { |r| row.tuple == r } - end - - matcher.failure_message = "Expected to get:\n" \ - "#{expected.map {|r| " #{r.inspect}" }.join("\n")}\n" \ - "instead, got:\n" \ - "#{got.map {|r| " #{r.inspect}" }.join("\n")}" - - found.compact.length == expected.length && got.compact.length == expected.length - end - end -end |