test/test_command.rb in boom-0.2.3 vs test/test_command.rb in boom-0.2.4
- old
+ new
@@ -72,16 +72,23 @@
STDIN.stat.stubs(:size).returns(4)
assert_match /a new list called newlist.* item in newlist is blah/, command('newlist item')
end
+ def test_list_creation_with_existing_items_name
+ command('list item foo')
+ assert_match /a new list called item.* key in item is bar/, command('item key bar')
+ end
+
def test_item_access
+ IO.stubs(:popen)
assert_match /copied https:\/\/github\.com to your clipboard/,
command('github')
end
def test_item_access_scoped_by_list
+ IO.stubs(:popen)
assert_match /copied https:\/\/github\.com to your clipboard/,
command('urls github')
end
def test_item_open_item
@@ -205,8 +212,27 @@
end
def test_random_list_not_exist
Boom::Platform.stubs(:system).returns('')
assert_match /couldn't find that list\./, command('random 39jc02jlskjbbac9')
+ end
+
+ def test_delete_item_list_not_exist
+ assert_match /couldn't find that list\./, command('urlz github delete')
+ end
+
+ def test_delete_item_wrong_list
+ command('urlz twitter https://twitter.com/')
+ assert_match /github not found in urlz/, command('urlz github delete')
+ end
+
+ def test_delete_item_different_name
+ command('foo bar baz')
+ assert_match /bar is gone forever/, command('foo bar delete')
+ end
+
+ def test_delete_item_same_name
+ command('duck duck goose')
+ assert_match /duck is gone forever/, command('duck duck delete')
end
end