test/test_helper.rb in reform-2.3.0.rc1 vs test/test_helper.rb in reform-2.3.0.rc2
- old
+ new
@@ -1,22 +1,32 @@
require "reform"
-require 'minitest/autorun'
+require "minitest/autorun"
require "representable/debug"
require "declarative/testing"
require "pp"
-require 'byebug'
+require "byebug"
require "reform/form/dry"
+
# setup test classes so we can test without dry being included
class TestForm < Reform::Form
feature Reform::Form::Dry
end
class TestContract < Reform::Contract
feature Reform::Form::Dry
end
+module Types
+ DRY_MODULE = Gem::Version.new(Dry::Types::VERSION) < Gem::Version.new("0.15.0") ? Dry::Types.module : Dry.Types()
+ include DRY_MODULE
+end
+
+DRY_TYPES_VERSION = Gem::Version.new(Dry::Types::VERSION)
+DRY_TYPES_CONSTANT = DRY_TYPES_VERSION < Gem::Version.new("0.13.0") ? Types::Form : Types::Params
+DRY_TYPES_INT_CONSTANT = DRY_TYPES_VERSION < Gem::Version.new("0.13.0") ? Types::Form::Int : Types::Params::Integer
+
class BaseTest < MiniTest::Spec
class AlbumForm < TestForm
property :title
property :hit do
@@ -32,12 +42,11 @@
Album = Struct.new(:title, :hit, :songs, :band)
Band = Struct.new(:label)
Label = Struct.new(:name)
Length = Struct.new(:minutes, :seconds)
-
- let (:hit) { Song.new("Roxanne") }
+ let(:hit) { Song.new("Roxanne") }
end
MiniTest::Spec.class_eval do
module Saveable
def save
@@ -47,6 +56,5 @@
def saved?
@saved
end
end
end
-