test/twin/twin_test.rb in disposable-0.0.8 vs test/twin/twin_test.rb in disposable-0.0.9
- old
+ new
@@ -17,11 +17,11 @@
# model Model::Album
end
class Song < Disposable::Twin
property :id # DISCUSS: needed for #save.
- property :name, :as => :title
+ property :name, :from => :title
property :album, :twin => Album
# model Model::Song
end
end
@@ -30,11 +30,11 @@
describe "#initialize" do
it do
twin = Twin::Song.new(song)
song.id = 2
- # :as maps public name
+ # :from maps public name
twin.name.must_equal "Broken" # public: #name
twin.id.must_equal 2
end
# override property with public name in constructor.
@@ -117,17 +117,17 @@
end
module Twin
class Album < Disposable::Twin
- property :record_name, :as => :name
+ property :record_name, :from => :name
# model Model::Album
end
class Song < Disposable::Twin
- property :name, :as => :title
- property :record, :twin => Album, :as => :album
+ property :name, :from => :title
+ property :record, :twin => Album, :from => :album
# model Model::Song
end
end
\ No newline at end of file