Sha256: 57667557a1f8c1083fa79ccb7d0b4e191d08746276e81c70f2d847366498b79d

Contents?: true

Size: 681 Bytes

Versions: 3

Compression:

Stored size: 681 Bytes

Contents

require 'spec_helper'

describe DummyInteractor do
  let(:dummy1) { 'testmedummy' }
  let(:dummy_object) do
    Class.new do
      attr_accessor :dummy1
    end.new
  end

  it { expect(DummyInteractor).to respond_to(:perform_on) }
  it { should respond_to(:perform_on) }

  it "sets @dummy1 on dummy_object" do
    DummyInteractor.perform_on(dummy_object, dummy1: dummy1)
    
    expect(dummy_object.dummy1).to eq dummy1
  end

  context "when called on instance" do

    it "sets @dummy1 on dummy_object" do
      interactor = DummyInteractor.new(dummy1: dummy1)
      interactor.perform_on(dummy_object)
      
      expect(dummy_object.dummy1).to eq dummy1
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
interactor-copy_context-0.0.3 spec/features/interactor_spec.rb
interactor-copy_context-0.0.2 spec/features/interactor_spec.rb
interactor-copy_context-0.0.1 spec/features/interactor_spec.rb