Sha256: 3b552da03f8aa4127334e3fb242c3cc21adda8f7f5d76595c0502cd07f4abb52
Contents?: true
Size: 473 Bytes
Versions: 5
Compression:
Stored size: 473 Bytes
Contents
require "spec_helper" describe ObservableModel do class Person attr_accessor :name end it "observes model" do person = Person.new person.name = "Marty" expect(person.name).to eq("Marty") person.extend ObservableModel person.add_observer(:name, self) person.name = "Julia" expect(@observed_name).to eq("Julia") expect(person.name).to eq("Julia") end def update(name) @observed_name = name end end
Version data entries
5 entries across 5 versions & 1 rubygems