Sha256: eb5bc91de21903c5034196d8463769a36f9d1ef50dc7bd5969f2b33c4d478e2a

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

require "test_helper"

class SkipSetterTest < MiniTest::Spec
  Album  = Struct.new(:title, :artist)
  Artist = Struct.new(:name)

  class AlbumTwin < Disposable::Twin
    feature Setup::SkipSetter

    property :title
    property :artist do
      property :name

      def name=(v)
        super(v.upcase)
      end
    end

    def title=(v)
      super(v.reverse)
    end
  end

  it do
    twin = AlbumTwin.new(Album.new("Wild Frontier", Artist.new("Gary Moore")))

    twin.title.must_equal "Wild Frontier"
    twin.artist.name.must_equal "Gary Moore"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
disposable-0.1.1 test/skip_setter_test.rb