test/test_helper.rb in reform-2.2.4 vs test/test_helper.rb in reform-2.3.0.rc1
- old
+ new
@@ -1,13 +1,24 @@
require "reform"
require 'minitest/autorun'
require "representable/debug"
require "declarative/testing"
require "pp"
+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
+
class BaseTest < MiniTest::Spec
- class AlbumForm < Reform::Form
+ class AlbumForm < TestForm
property :title
property :hit do
property :title
end
@@ -15,11 +26,11 @@
collection :songs do
property :title
end
end
- Song = Struct.new(:title, :length)
+ Song = Struct.new(:title, :length, :rating)
Album = Struct.new(:title, :hit, :songs, :band)
Band = Struct.new(:label)
Label = Struct.new(:name)
Length = Struct.new(:minutes, :seconds)
@@ -37,13 +48,5 @@
@saved
end
end
end
-require "reform/form/dry"
-Reform::Contract.class_eval do
- feature Reform::Form::Dry
-end
-# FIXME!
-Reform::Form.class_eval do
- feature Reform::Form::Dry
-end