Permalink
Browse files

Extract fixture loader

  • Loading branch information...
1 parent 09bff90 commit dd8699153f044d6aa1db7b53490852ab4f2961b2 @sstephenson committed Sep 19, 2010
Showing with 6 additions and 5 deletions.
  1. +1 −1 Cakefile
  2. +4 −0 test/lib/fixtures.coffee
  3. +1 −4 test/test_preprocessor.coffee
View
2 Cakefile
@@ -1,4 +1,4 @@
-require.paths.unshift __dirname + '/lib'
+require.paths.unshift __dirname + '/lib', __dirname + '/test/lib'
task 'test', 'Run tests', ->
{testrunner} = require 'nodeunit'
View
4 test/lib/fixtures.coffee
@@ -0,0 +1,4 @@
+fs = require "fs"
+
+exports.fixture = (filename) ->
+ fs.readFileSync __dirname + "/../fixtures/" + filename, "utf-8"
View
5 test/test_preprocessor.coffee
@@ -1,8 +1,5 @@
{preprocess} = require "eco/preprocessor"
-fs = require "fs"
-
-fixture = (filename) ->
- fs.readFileSync __dirname + "/fixtures/" + filename, "utf-8"
+{fixture} = require "fixtures"
module.exports =
"preprocessing fixtures/hello.eco": (test) ->

0 comments on commit dd86991

Please sign in to comment.