test/triad_test.rb in triad-0.1.1 vs test/triad_test.rb in triad-0.1.2
- old
+ new
@@ -47,9 +47,21 @@
assert_equal [object], triad.values(:surprise)
assert_equal [object], triad.values('OutOfOrder')
end
end
+describe Triad, '#update' do
+ let(:triad){ Triad.new }
+
+ it 'updates a descriptor and object for the given key' do
+ object = Object.new
+ triad << [:test, 'Test', object]
+ assert_equal ['Test'], triad.descriptors(:test)
+ triad.update(:test, 'Updated', Object.new)
+ assert_equal ['Updated'], triad.descriptors(:test)
+ end
+end
+
describe Triad, '#keys' do
let(:user){ Object.new }
let(:triad){
tri = Triad.new
tri << [:admin, 'Admin', user]
\ No newline at end of file