diff options
| author | Stephen Blott | 2014-11-02 06:00:20 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2014-11-02 06:00:20 +0000 | 
| commit | a61d69ea40c9f2683107416eccab8046ab00c87d (patch) | |
| tree | 6800ae1e3d45bacd6a71f2ab8a9622e94a78ac4c /tests/unit_tests | |
| parent | 943eaae9868ad0298669564b7b50af477646746a (diff) | |
| download | vimium-a61d69ea40c9f2683107416eccab8046ab00c87d.tar.bz2 | |
Refactor Utils.hasChromePrefix and add tests.
Diffstat (limited to 'tests/unit_tests')
| -rw-r--r-- | tests/unit_tests/utils_test.coffee | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee index 76a023ed..b2d656ab 100644 --- a/tests/unit_tests/utils_test.coffee +++ b/tests/unit_tests/utils_test.coffee @@ -47,6 +47,20 @@ context "convertToUrl",      assert.equal "http://www.google.com/search?q=google", Utils.convertToUrl("google")      assert.equal "http://www.google.com/search?q=go%20ogle.com", Utils.convertToUrl("go ogle.com") +context "hasChromePrefix", +  should "detect chrome prefixes of URLs", -> +    assert.isTrue Utils.hasChromePrefix "about:foobar" +    assert.isTrue Utils.hasChromePrefix "view-source:foobar" +    assert.isTrue Utils.hasChromePrefix "chrome-extension:foobar" +    assert.isTrue Utils.hasChromePrefix "data:foobar" +    assert.isTrue Utils.hasChromePrefix "data:" +    assert.isFalse Utils.hasChromePrefix "" +    assert.isFalse Utils.hasChromePrefix "about" +    assert.isFalse Utils.hasChromePrefix "view-source" +    assert.isFalse Utils.hasChromePrefix "chrome-extension" +    assert.isFalse Utils.hasChromePrefix "data" +    assert.isFalse Utils.hasChromePrefix "data :foobar" +  context "Function currying",    should "Curry correctly", ->      foo = (a, b) -> "#{a},#{b}"  | 
