test/test_command.rb in boom-0.0.9 vs test/test_command.rb in boom-0.0.10
- old
+ new
@@ -61,16 +61,33 @@
def test_item_access_scoped_by_list
assert_match /copied https:\/\/github\.com to your clipboard/,
command('urls github')
end
+
+ def test_item_open_url
+ Boom::Platform.stubs(:open_command).returns("echo")
+ assert_match /opened https:\/\/github\.com for you/,
+ command('open github')
+ end
+ def test_item_open_lists
+ Boom::Platform.stubs(:open_command).returns("echo")
+ assert_match /opened all of \"urls\" for you/,
+ command('open urls')
+ end
+
def test_item_creation
assert_match /"twitter" in "urls"/,
command('urls twitter http://twitter.com/holman')
end
+ def test_item_creation_long_value
+ assert_match /is "tanqueray hendricks bombay"/,
+ command('urls gins tanqueray hendricks bombay')
+ end
+
def test_list_deletion_no
STDIN.stubs(:gets).returns('n')
assert_match /Just kidding then/, command('urls delete')
end
@@ -99,7 +116,27 @@
assert_match 'boom help', command('-d')
end
def test_nonexistent_item_access_scoped_by_list
assert_match /"twitter" not found in "urls"/, command('urls twitter')
+ end
+
+ def test_echo_item
+ assert_match /https:\/\/github\.com/, command('echo github')
+ end
+
+ def test_echo_item_shorthand
+ assert_match /https:\/\/github\.com/, command('e github')
+ end
+
+ def test_echo_item_does_not_exist
+ assert_match /"wrong" not found/, command('echo wrong')
+ end
+
+ def test_echo_list_item
+ assert_match /https:\/\/github\.com/, command('echo urls github')
+ end
+
+ def test_echo_list_item_does_not_exist
+ assert_match /"wrong" not found in "urls"/, command('echo urls wrong')
end
end