test/triad_test.rb in triad-0.1.0 vs test/triad_test.rb in triad-0.1.1
- old
+ new
@@ -67,10 +67,15 @@
it 'returns the keys for the given key' do
assert_equal [:admin], triad.keys(:admin)
end
+ it 'returns all keys when given no argument' do
+ triad << [:other, 'Other', user]
+ assert_equal [:admin, :other], triad.keys
+ end
+
it 'errors when the given key is not found' do
assert_raises(Triad::KeyNotPresent){
triad.keys(:invalid_key)
}
end
@@ -106,10 +111,15 @@
it 'returns the descriptors for the given descriptor' do
assert_equal ['Admin'], triad.descriptors('Admin')
end
+ it 'returns all descriptors when given no argument' do
+ triad << [:other, 'Other', user]
+ assert_equal ['Admin', 'Other'], triad.descriptors
+ end
+
it 'errors when the given descriptor is not found' do
assert_raises(Triad::DescriptorNotPresent){
triad.descriptors('Not Present')
}
end
@@ -140,9 +150,15 @@
end
it 'returns the value for the given descriptor' do
assert_equal [user], triad.values('Admin')
end
+
+ it 'returns all values when given no argument' do
+ triad << [:other, 'Other', user]
+ assert_equal [user], triad.values
+ end
+
it 'errors when the given key is not found' do
assert_raises(Triad::KeyNotPresent){
triad.values(:invalid_key)
}
\ No newline at end of file