Sha256: 18313f2e25cd75b537af5be1657fb957edbb2d3183556beab4fa035c49132813
Contents?: true
Size: 1.33 KB
Versions: 3
Compression:
Stored size: 1.33 KB
Contents
require "reform" require "minitest/autorun" require "representable/debug" require "declarative/testing" require "pp" require "pry-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 property :title end collection :songs do property :title end end 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) let(:hit) { Song.new("Roxanne") } end MiniTest::Spec.class_eval do module Saveable def save @saved = true end def saved? @saved end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
reform-2.3.3 | test/test_helper.rb |
reform-2.3.2 | test/test_helper.rb |
reform-2.3.1 | test/test_helper.rb |