Sha256: caba1b37d57cf0f1a3bd1e0574a1125caaf5cf72262ea27f99ffc831ecfe8553

Contents?: true

Size: 846 Bytes

Versions: 6

Compression:

Stored size: 846 Bytes

Contents

require "reform"
require 'minitest/autorun'
require "representable/debug"
require "declarative/testing"
require "pp"

class BaseTest < MiniTest::Spec
  class AlbumForm < Reform::Form
    property :title

    property :hit do
      property :title
    end

    collection :songs do
      property :title
    end
  end

  Song   = Struct.new(:title, :length)
  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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reform-2.2.4 test/test_helper.rb
reform-2.2.3 test/test_helper.rb
reform-2.2.2 test/test_helper.rb
reform-2.2.1 test/test_helper.rb
reform-2.2.0 test/test_helper.rb
reform-2.2.0.rc1 test/test_helper.rb