test/test_helper.rb in disposable-0.4.3 vs test/test_helper.rb in disposable-0.4.4

- old
+ new

@@ -1,20 +1,23 @@ require "disposable" require "minitest/autorun" -require "pp" require "representable/debug" +# require "pp" require "declarative/testing" +require "disposable/twin/coercion" +DRY_TYPES_CONSTANT = Disposable::Twin::Coercion::DRY_TYPES_CONSTANT +DRY_TYPES_INT_CONSTANT = Disposable::Twin::Coercion::DRY_TYPES_VERSION < 13 ? 'Int' : 'Integer' + class Track def initialize(options={}) @title = options[:title] end attr_reader :title end - # require 'active_record' # require 'database_cleaner' # DatabaseCleaner.strategy = :truncation require 'active_record' @@ -37,22 +40,22 @@ ) ActiveRecord::Schema.define do create_table :artists do |table| table.column :name, :string - table.timestamps + table.timestamps null: false end create_table :songs do |table| table.column :title, :string table.column :artist_id, :integer table.column :album_id, :integer - table.timestamps + table.timestamps null: false end create_table :albums do |table| table.column :name, :string table.column :artist_id, :integer - table.timestamps + table.timestamps null: false end end module Disposable module Comparable @@ -69,10 +72,10 @@ def save @saved = true end def saved? - @saved + defined?(@saved) ? @saved : nil end end end