Sha256: bba415deb2967e8b1c393d730d1754c1a7613529c6651da5e61a3ae61b13af0f

Contents?: true

Size: 480 Bytes

Versions: 5

Compression:

Stored size: 480 Bytes

Contents

require 'test_helper'
require 'cell/twin'

class TwinTest < MiniTest::Spec
  class SongCell < Cell::ViewModel
    class Twin < Disposable::Twin
      property :title
      option :online?
    end

    include Cell::Twin
    twin Twin

    def show
      "#{title} is #{online?}"
    end

    def title
      super.downcase
    end
  end

  let (:model) { OpenStruct.new(:title => "Kenny") }

  it { SongCell.new(nil, model, :online? => true).call.must_equal "kenny is true" }
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
cells-4.0.0.beta4 test/twin_test.rb
cells-4.0.0.beta3 test/twin_test.rb
cells-4.0.0.beta2 test/twin_test.rb
cells-4.0.0.beta1 test/twin_test.rb
cells-jamie-4.0.0.alpha1 test/vm/twin_test.rb