summaryrefslogtreecommitdiffhomepage
path: root/dragon/assert.rb
diff options
context:
space:
mode:
Diffstat (limited to 'dragon/assert.rb')
-rw-r--r--dragon/assert.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/dragon/assert.rb b/dragon/assert.rb
index bc21add..974846a 100644
--- a/dragon/assert.rb
+++ b/dragon/assert.rb
@@ -24,10 +24,10 @@ To add an assertion open up this class and write:
class Assert
def custom_assertion actual, expected, message = nil
- # this tell Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
+ # this tells Game Toolkit that an assertion was performed (so that the test isn't marked inconclusive).
@assertion_performed = true
- # perform your custom logic here and rais an exception to denote a failure.
+ # perform your custom logic here and raise an exception to denote a failure.
raise "Some Error. #{message}."
end
@@ -37,14 +37,14 @@ end
attr :assertion_performed
=begin
-Us this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
+Use this if you are throwing your own exceptions and you want to mark the tests as ran (so that it wont be marked as inconclusive).
=end
def ok!
@assertion_performed = true
end
=begin
-Assert if a value is a thruthy value. All assert method take an optional final parameter that is the message to display to the user.
+Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.
@example
@@ -98,7 +98,7 @@ end
@assertion_performed = true
if actual != expected
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
- message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\ndid not equal\n\nexpected:\n#{expected}\n#{message}"
raise message
end
nil
@@ -108,7 +108,7 @@ end
@assertion_performed = true
if actual == expected
actual_string = "#{actual}#{actual.nil? ? " (nil) " : " " }".strip
- message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}.\n#{message}"
+ message = "actual:\n#{actual_string}\n\nequaled\n\nexpected:\n#{expected}\n#{message}"
raise message
end
nil