Sha256: ee6ded9db5b37b8896f390ef46397183eff0a6ef71f645353de4dda7582f18ed

Contents?: true

Size: 706 Bytes

Versions: 9

Compression:

Stored size: 706 Bytes

Contents

require 'cooperator'

class Interactor
  prepend Cooperator
end

subject Cooperator

spec '#success? delegates to context.success?' do
  interactor = Interactor.new

  interactor.context.success!

  assert interactor, :success?

  interactor.context.failure!

  refute interactor, :success?
end

spec '#failure? delegates to context.failure?' do
  interactor = Interactor.new

  interactor.context.failure!

  assert interactor, :failure?

  interactor.context.success!

  refute interactor, :failure?
end

spec '#include? delegates to context.include?' do
  interactor = Interactor.new

  refute interactor, :include?, :name

  interactor.context.name = 'Apple'

  assert interactor, :include?, :name
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cooperator-0.3.3 spec/predicates.rb
cooperator-0.3.2 spec/predicates.rb
cooperator-0.3.1 spec/predicates.rb
cooperator-0.2.5 spec/predicates.rb
cooperator-0.2.4 spec/predicates.rb
cooperator-0.2.3 spec/predicates.rb
cooperator-0.2.2 spec/predicates.rb
cooperator-0.2.1 spec/predicates.rb
cooperator-0.2.0 spec/predicates.rb