Sha256: 2b437cb09370f689afce305f786f666caa0e04f7ddb1dd40f461bbb35d19efa3

Contents?: true

Size: 525 Bytes

Versions: 21

Compression:

Stored size: 525 Bytes

Contents

require 'test_helper'

class VirtualTest < MiniTest::Spec
  class CreditCardTwin < Disposable::Twin
    include Sync
    property :credit_card_number, virtual: true # no read, no write, it's virtual.
  end

  let (:twin) { CreditCardTwin.new(Object.new) }

  it {
    twin.credit_card_number = "123"

    twin.credit_card_number.must_equal "123"  # this is still readable in the UI.

    twin.sync

    hash = {}
    twin.sync do |nested|
      hash = nested
    end

    hash.must_equal("credit_card_number"=> "123")
  }
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
disposable-0.3.1 test/twin/virtual_test.rb
disposable-0.3.0 test/twin/virtual_test.rb
disposable-0.2.6 test/twin/virtual_test.rb
disposable-0.2.5 test/twin/virtual_test.rb
disposable-0.2.4 test/twin/virtual_test.rb
disposable-0.2.3 test/twin/virtual_test.rb
disposable-0.2.2 test/twin/virtual_test.rb
disposable-0.2.1 test/twin/virtual_test.rb
disposable-0.1.15 test/twin/virtual_test.rb
disposable-0.2.0 test/twin/virtual_test.rb
disposable-0.2.0.rc2 test/twin/virtual_test.rb
disposable-0.2.0.rc1 test/twin/virtual_test.rb
disposable-0.1.14 test/twin/virtual_test.rb
disposable-0.1.13 test/twin/virtual_test.rb
disposable-0.1.12 test/twin/virtual_test.rb
disposable-0.1.11 test/twin/virtual_test.rb
disposable-0.1.9 test/twin/virtual_test.rb
disposable-0.1.8 test/twin/virtual_test.rb
disposable-0.1.7 test/twin/virtual_test.rb
disposable-0.1.6 test/twin/virtual_test.rb