Sha256: c304b7f96b8b0dcbcd68820bfee8cc58bc6fb068c6f4d967abe62bde6c1aa1c7
Contents?: true
Size: 816 Bytes
Versions: 14
Compression:
Stored size: 816 Bytes
Contents
require 'spec_helper' require 'volt/reactive/reactive_accessors' class TestReactiveAccessors include ReactiveAccessors reactive_accessor :_name end describe ReactiveAccessors do it "should assign a reactive value" do inst = TestReactiveAccessors.new inst._name = 'Ryan' expect(inst._name).to eq('Ryan') end it "should start nil" do inst = TestReactiveAccessors.new expect(inst._name).to eq(nil) end it 'should trigger changed when assigning a new value' do inst = TestReactiveAccessors.new values = [] -> { values << inst._name }.watch! expect(values).to eq([nil]) inst._name = 'Ryan' Computation.flush! expect(values).to eq([nil,'Ryan']) inst._name = 'Stout' Computation.flush! expect(values).to eq([nil,'Ryan','Stout']) end end
Version data entries
14 entries across 14 versions & 1 rubygems