Skip to content

Commit

Permalink
Noscript now compiles test_case. Removing old array.ns
Browse files Browse the repository at this point in the history
  • Loading branch information
Josep M. Bach committed Jan 15, 2012
1 parent a75aa46 commit e40a8e6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 63 deletions.
21 changes: 0 additions & 21 deletions kernel/array.ns

This file was deleted.

84 changes: 42 additions & 42 deletions kernel/test_case.ns
Expand Up @@ -65,46 +65,46 @@ TestCase = Object.clone({
@errors.push('Expected #{value} to be truthy.')
end
# @assertions.increment()
end #,
#
# # Asserts equality between two objects.
# #
# # @param [Object] expected
# # The expected value.
# #
# # @param [Object] actual
# # The actual value.
# assert equal: -> expected, actual
# if expected == actual
# print('\e[32m.\e[0m')
# else
# print('\e[31mF\e[0m')
# @errors.push('Expected #{expected}, got #{actual}.')
# end
# @assertions.increment()
# end,
#
# # Prints the report with the number of +tests+, +assertions+ and failures
# #
# # It also prints a failure report.
# print report: ->
# puts('\n\n\e[0m#{@tests} tests, #{@assertions} assertions, #{@errors.length()} failures')
# @errors.each(-> error
# puts(' * #{error}')
# end)
# end,
#
# # Runs the test case and prints the report afterwards.
# run: ->
# @each slot(-> name, test
# if name.starts with('it')
# @setup()
# test()
# @teardown()
# @tests.increment()
# end
# end)
#
# @print report()
# end
end,

# Asserts equality between two objects.
#
# @param [Object] expected
# The expected value.
#
# @param [Object] actual
# The actual value.
assert equal: -> expected, actual
if expected == actual
print('\e[32m.\e[0m')
else
print('\e[31mF\e[0m')
@errors.push('Expected #{expected}, got #{actual}.')
end
# @assertions.increment()
end,

# Prints the report with the number of +tests+, +assertions+ and failures
#
# It also prints a failure report.
print report: ->
puts('\n\n\e[0m#{@tests} tests, #{@assertions} assertions, #{@errors.length()} failures')
@errors.each(-> error
puts(' * #{error}')
end)
end,

# Runs the test case and prints the report afterwards.
run: ->
@each slot(-> name, test
if name.starts with('it')
@setup()
test()
@teardown()
@tests.increment()
end
end)

@print report()
end
})

0 comments on commit e40a8e6

Please sign in to comment.