Skip to content

Instantly share code, notes, and snippets.

@deanrad
Created April 30, 2014 02:11
Show Gist options
  • Select an option

  • Save deanrad/11416684 to your computer and use it in GitHub Desktop.

Select an option

Save deanrad/11416684 to your computer and use it in GitHub Desktop.
diff --git a/test/spec/test_reactive.coffee b/test/spec/test_reactive.coffee
index c8cd535..fac783e 100644
--- a/test/spec/test_reactive.coffee
+++ b/test/spec/test_reactive.coffee
@@ -561,9 +561,11 @@ describe 'RawHtml', ->
).toThrow()
describe 'rxt', ->
- it 'should take as contents (arrays of) strings, elements, RawHtml, or $', ->
+ it 'should take as contents (arrays of) numbers, strings, elements, RawHtml, $ or null', ->
for useArray in [false, true]
maybeArray = (x) -> if useArray then [x] else x
+ expect(outerHtml(div(maybeArray(2)))).toBe('<div>2</div>')
+ expect(outerHtml(div(maybeArray(null)))).toBe('<div></div>')
expect(outerHtml(div(maybeArray('hi')))).toBe('<div>hi</div>')
expect(outerHtml(div(maybeArray($('<em>hi</em>'))))).toBe('<div><em>hi</em></div>')
expect(outerHtml(div(maybeArray(rxt.rawHtml('<em>hi</em>'))))).toBe('<div><em>hi</em></div>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment