Extend tests
This commit is contained in:
parent
15b627dfce
commit
7b390ce77a
3 changed files with 15 additions and 9 deletions
|
@ -23,13 +23,9 @@ describe 'core module', ->
|
|||
|
||||
assert.is.table lua_first.test
|
||||
assert.is.string txt_first.test
|
||||
|
||||
it 'recursively binds to subdirectories', ->
|
||||
assert.equal 'file in subdirectory', config.sub.test
|
||||
|
||||
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'
|
||||
it 'returns nil for missing configs', ->
|
||||
assert.nil config.missing
|
||||
|
|
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