Sha256: 12a05b8eba0b73811336b5e426bb210cc745b1d6f651f35a365f07bf9a120571

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

require "pp"
require "trailblazer"
require "minitest/autorun"

# TODO: convert tests to non-rails.
require "reform"
require "reform/form/active_model/validations"
Reform::Form.class_eval do
  include Reform::Form::ActiveModel::Validations
end

# require "trailblazer/deprecation/context.rb"

module Mock
  class Result
    def initialize(bool); @bool = bool end
    def success?; @bool end
    def errors; ["hihi"] end
  end
end

module Test
  module ReturnCall
    def self.included(includer)
      includer._insert :_insert, ReturnResult, {replace: Trailblazer::Operation::Result::Build}, ReturnResult, ""
    end
  end
  ReturnResult = ->(last, input, options) { input }
end

require "pp"

Minitest::Spec::Operation = Trailblazer::Operation

Memo = Struct.new(:id, :body) do
  def self.find(id)
    return new(id, "Yo!") if id
    nil
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trailblazer-2.1.0.beta5 test/test_helper.rb
trailblazer-2.1.0.beta4 test/test_helper.rb