Class: DummyDatabase

Inherits:
Sequel::Database show all
Defined in:
lib/sequel/spec/core/database_spec.rb

Constant Summary

Constants inherited from Sequel::Database

Sequel::Database::ADAPTERS, Sequel::Database::AUTOINCREMENT, Sequel::Database::CASCADE, Sequel::Database::COMMA_SEPARATOR, Sequel::Database::MSSQL_DEFAULT_RE, Sequel::Database::MYSQL_TIMESTAMP_RE, Sequel::Database::NOT_NULL, Sequel::Database::NO_ACTION, Sequel::Database::NULL, Sequel::Database::POSTGRES_DEFAULT_RE, Sequel::Database::PRIMARY_KEY, Sequel::Database::RESTRICT, Sequel::Database::SET_DEFAULT, Sequel::Database::SET_NULL, Sequel::Database::SQL_BEGIN, Sequel::Database::SQL_COMMIT, Sequel::Database::SQL_RELEASE_SAVEPOINT, Sequel::Database::SQL_ROLLBACK, Sequel::Database::SQL_ROLLBACK_TO_SAVEPOINT, Sequel::Database::SQL_SAVEPOINT, Sequel::Database::STRING_DEFAULT_RE, Sequel::Database::TEMPORARY, Sequel::Database::TRANSACTION_BEGIN, Sequel::Database::TRANSACTION_COMMIT, Sequel::Database::TRANSACTION_ROLLBACK, Sequel::Database::UNDERSCORE, Sequel::Database::UNIQUE, Sequel::Database::UNSIGNED

Instance Attribute Summary collapse

Attributes inherited from Sequel::Database

#default_schema, #loggers, #opts, #pool, #prepared_statements

Instance Method Summary collapse

Methods inherited from Sequel::Database

#<<, #[], adapter_class, adapter_scheme, #add_column, #add_index, #alter_table, #call, #cast_type_literal, connect, #connect, #create_or_replace_view, #create_table, #create_table!, #create_table?, #create_view, #database_type, #disconnect, #drop_column, #drop_index, #drop_table, #drop_view, #dump_indexes_migration, #dump_schema_migration, #dump_table_schema, #execute_ddl, #execute_dui, #execute_insert, #fetch, #from, #get, identifier_input_method, #identifier_input_method, identifier_input_method=, #identifier_input_method=, #identifier_output_method, identifier_output_method, identifier_output_method=, #identifier_output_method=, #initialize, #inspect, #literal, #log_info, #logger=, #query, #quote_identifiers=, quote_identifiers=, #quote_identifiers?, #rename_column, #rename_table, #run, #schema, #select, #serial_primary_key_options, #set_column_default, #set_column_type, single_threaded=, #single_threaded?, #supports_savepoints?, #synchronize, #table_exists?, #test_connection, #typecast_value, #uri, #url

Methods included from Sequel::Metaprogramming

#meta_def

Constructor Details

This class inherits a constructor from Sequel::Database

Instance Attribute Details

#sqlsObject (readonly)

Returns the value of attribute sqls


365
366
367
# File 'lib/sequel/spec/core/database_spec.rb', line 365

def sqls
  @sqls
end

Instance Method Details

#datasetObject


374
375
376
# File 'lib/sequel/spec/core/database_spec.rb', line 374

def dataset
  DummyDataset.new(self)
end

#execute(sql, opts = {}) ⇒ Object


367
368
369
370
# File 'lib/sequel/spec/core/database_spec.rb', line 367

def execute(sql, opts={})
  @sqls ||= []
  @sqls << sql
end

#transactionObject


372
# File 'lib/sequel/spec/core/database_spec.rb', line 372

def transaction; yield; end