Sha256: 951fea19457a0e5fdb51ddaf58a7f3eb1d2b6ec5b6d777cd264e529c990a7637

Contents?: true

Size: 618 Bytes

Versions: 9

Compression:

Stored size: 618 Bytes

Contents

require 'test_helper'

class InheritanceTest < MiniTest::Spec
  let (:decorator) do
    Class.new(Representable::Decorator) do
      property :title
    end
  end

  # Decorator.new.representable_attrs != Decorator.representable_attrs
  it "doesn't clone for instantiated decorator" do
    instance = decorator.new(Object.new)
    instance.send(:representable_attrs).first.options[:instance] = true

    # we didn't clone and thereby change the original config:
    instance.send(:representable_attrs).to_s.must_equal decorator.representable_attrs.to_s
  end

  # TODO:  ? (performance?)
  #  more tests on cloning
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
representable-1.7.6 test/inheritance_test.rb
representable-1.7.5 test/inheritance_test.rb
representable-1.7.4 test/inheritance_test.rb
representable-1.7.3 test/inheritance_test.rb
representable-1.7.2 test/inheritance_test.rb
representable-1.7.1 test/inheritance_test.rb
representable-1.7.0 test/inheritance_test.rb
representable-1.6.1 test/inheritance_test.rb
representable-1.6.0 test/inheritance_test.rb