Sha256: b9d7b88b486ca3fd5110d0e558a015d544b2c682e184d6196e7ca8be87c193d6

Contents?: true

Size: 745 Bytes

Versions: 35

Compression:

Stored size: 745 Bytes

Contents

require 'test_helper'

class PassAlongTest < ActiveSupport::TestCase

  # After a method is called on a Responder, we need to send all instance variables
  # that were created back to the controller for the view
  test 'the receiver receives all instance variables from the sender after a method is called' do
    sam = Sam.new("Sam", "M", "Opportunist")
    bob = Bob.new
    PassAlong.all_variables(sam, bob)
    sam.useless_method
    assert_equal [:@gender, :@job_title, :@name], bob.instance_variables.sort
  end


  class Sam
    extend AfterDo

    def initialize(name, gender, job_title)
      @name      = name
      @gender    = gender
      @job_title = job_title
    end

    def useless_method
    end

  end

  class Bob
  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
husky-0.3.8 test/unit/pass_along_test.rb
husky-0.3.7 test/unit/pass_along_test.rb
husky-0.3.6 test/unit/pass_along_test.rb
husky-0.3.5 test/unit/pass_along_test.rb
husky-0.3.4 test/unit/pass_along_test.rb
husky-0.3.3 test/unit/pass_along_test.rb
husky-0.3.2 test/unit/pass_along_test.rb
husky-0.3.1 test/unit/pass_along_test.rb
husky-0.3.0 test/unit/pass_along_test.rb
husky-0.2.9 test/unit/pass_along_test.rb
husky-0.2.8 test/unit/pass_along_test.rb
husky-0.2.7 test/unit/pass_along_test.rb
husky-0.2.6 test/unit/pass_along_test.rb
husky-0.2.5 test/unit/pass_along_test.rb
husky-0.2.4 test/unit/pass_along_test.rb
husky-0.2.3 test/unit/pass_along_test.rb
husky-0.2.2 test/unit/pass_along_test.rb
husky-0.2.1 test/unit/pass_along_test.rb
husky-0.2.0 test/unit/pass_along_test.rb
husky-0.1.9 test/unit/pass_along_test.rb