Add reader factory, improve tests

This commit is contained in:
Vit Brunner
2013-06-15 18:12:24 +01:00
parent edd50af4a9
commit 303bac7bbe
6 changed files with 31 additions and 1 deletions
@@ -1,5 +1,4 @@
this.testReader = (name, testCases) ->
injector = angular.injector(["ng", "sideBySide"])
reader = injector.get(name)
for testCase in testCases
@@ -0,0 +1,9 @@
test("readerFactory", () ->
factory = injector.get("readerFactory")
ok(factory("somefile.md"))
ok(factory("otherfile.json"))
throws(() ->
factory("microsoft.doc")
, /unknown/i)
)