Skip to content

c080609a/schema_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Readme

Testing gem interactor-contracts

Details

No superclass, on_breach is called:

module Api
  module V2
    class FetchThreedsParams
      include Interactor
      include Interactor::Contracts

      expects do
        required(:user).filled
      end

      on_breach do |breaches|
        puts '1'*30
      end

      before do

      end

      def call

      end
    end
  end
end

# rails c
# Running via Spring preloader in process 70120
# Loading development environment (Rails 5.2.4.4)
# 2.5.1 :001 > Api::V2::FetchThreedsParams.call
# 111111111111111111111111111
#  => #<Interactor::Context>

With superclass, on_breach is not called:

class BaseInteractor
  include Interactor
  include Interactor::Contracts
end

module Api
  class FetchThreedsParams < ::BaseInteractor
    expects do
      required(:user).filled
    end

    on_breach do |breaches|
      puts '1'*30
    end

    before do

    end

    def call

    end
  end
end

# rails c
# Running via Spring preloader in process 70120
# Loading development environment (Rails 5.2.4.4)
# 2.5.1 :001 > Api::FetchThreedsParams.call
# => #<Interactor::Context user=["user is missing"]>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published