aboutsummaryrefslogtreecommitdiffstats
path: root/spec/core
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-22 10:51:30 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-22 10:55:49 +0000
commitde154813f056cd1bef891bb02a6852d9c11b3f4f (patch)
tree1d624c9c8fa92875db035aba50e3999e388a1f6e /spec/core
parentnew meta/doc system (diff)
downloadalive-de154813f056cd1bef891bb02a6852d9c11b3f4f.tar.gz
alive-de154813f056cd1bef891bb02a6852d9c11b3f4f.zip
more Errors, doc
Diffstat (limited to 'spec/core')
-rw-r--r--spec/core/tag_spec.moon28
1 files changed, 11 insertions, 17 deletions
diff --git a/spec/core/tag_spec.moon b/spec/core/tag_spec.moon
index a4491b0..87e02e2 100644
--- a/spec/core/tag_spec.moon
+++ b/spec/core/tag_spec.moon
@@ -3,15 +3,9 @@ import Registry from require 'core.registry'
import Logger from require 'logger'
Logger.init 'silent'
-with_reg = (fn) ->
- registry = Registry!
- fn = registry\wrap_eval fn
- fn, registry
-
-do_reg = (fn) ->
- fn, reg = with_reg fn
- fn!
- reg
+reg = Registry!
+setup -> reg\begin_eval!
+teardown -> reg\end_eval!
describe 'Tag', ->
describe 'should be constructable', ->
@@ -36,32 +30,32 @@ describe 'Tag', ->
assert.is.equal expect, tostring tag
assert.has.error tag\stringify
- it 'from parsed tags', with_reg ->
+ it 'from parsed tags', ->
parent = Tag.parse '1'
original = Tag.parse '2'
tag = original\clone parent
do_asserts tag, '1.2'
- it 'but not from blank tags', with_reg ->
+ it 'but not from blank tags', ->
parent = Tag.parse '1'
original = Tag.blank!
tag = original\clone parent
do_asserts tag, '1.?'
- it 'with blank parent', with_reg ->
+ it 'with blank parent', ->
parent = Tag.blank!
original = Tag.parse '2'
tag = original\clone parent
do_asserts tag, '?.2'
- it 'completely blank', with_reg ->
+ it 'completely blank', ->
parent = Tag.blank!
original = Tag.blank!
tag = original\clone parent
do_asserts tag, '?.?'
describe 'should be set-able', ->
- it 'only if blank', with_reg ->
+ it 'only if blank', ->
tag = Tag.parse '42'
assert.has.error -> tag\set 43
@@ -71,13 +65,13 @@ describe 'Tag', ->
clone = tag\clone Tag.blank!
assert.has.error -> clone\set 42
- it 'and stores the value', with_reg ->
+ it 'and stores the value', ->
blank = Tag.blank!
blank\set 12
assert.is.equal blank.value, 12
- it 'sets the original if cloned', with_reg ->
+ it 'sets the original if cloned', ->
original = Tag.blank!
parent = Tag.parse '7'
@@ -92,7 +86,7 @@ describe 'Tag', ->
assert.is.equal original.value, 11
- it 'requires the parent to be registered if cloned', with_reg ->
+ it 'requires the parent to be registered if cloned', ->
original = Tag.blank!
parent = Tag.blank!