Extend tests
This commit is contained in:
parent
15b627dfce
commit
7b390ce77a
3 changed files with 15 additions and 9 deletions
|
@ -24,12 +24,8 @@ describe 'core module', ->
|
||||||
assert.is.table lua_first.test
|
assert.is.table lua_first.test
|
||||||
assert.is.string txt_first.test
|
assert.is.string txt_first.test
|
||||||
|
|
||||||
describe 'raw loader', ->
|
it 'recursively binds to subdirectories', ->
|
||||||
before_each -> export loader = require 'glass.raw'
|
assert.equal 'file in subdirectory', config.sub.test
|
||||||
it 'loads files as plain text', ->
|
|
||||||
assert.same 'plain text\n', loader 'spec/fixtures/test'
|
|
||||||
|
|
||||||
describe 'lua loader', ->
|
it 'returns nil for missing configs', ->
|
||||||
before_each -> export loader = require 'glass.lua'
|
assert.nil config.missing
|
||||||
it 'loads Lua files', ->
|
|
||||||
assert.same { foo: 'bar', tab: {} }, loader 'spec/fixtures/test'
|
|
||||||
|
|
1
spec/fixtures/sub/test.lua
vendored
Normal file
1
spec/fixtures/sub/test.lua
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
return 'file in subdirectory'
|
9
spec/loaders_spec.moon
Normal file
9
spec/loaders_spec.moon
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
describe 'raw loader', ->
|
||||||
|
before_each -> export loader = require 'glass.raw'
|
||||||
|
it 'loads files as plain text', ->
|
||||||
|
assert.same 'plain text\n', loader 'spec/fixtures/test'
|
||||||
|
|
||||||
|
describe 'lua loader', ->
|
||||||
|
before_each -> export loader = require 'glass.lua'
|
||||||
|
it 'loads Lua files', ->
|
||||||
|
assert.same { foo: 'bar', tab: {} }, loader 'spec/fixtures/test'
|
Loading…
Reference in a new issue