diff options
| author | _Tradam <[email protected]> | 2021-12-16 19:22:26 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-16 19:22:26 -0500 |
| commit | 5954b9beb4d4a3b4f248d72d1851195f030558a8 (patch) | |
| tree | fecd8aa840a25afdb502915b0fdb4d03b7ed339a /dragon/assert.rb | |
| parent | 2f845281f133849256b57bb08fd3e9ae57600784 (diff) | |
| parent | eaa29e72939f5edf61735ccbb73c36ee89369f65 (diff) | |
| download | dragonruby-game-toolkit-contrib-master.tar.gz dragonruby-game-toolkit-contrib-master.zip | |
Diffstat (limited to 'dragon/assert.rb')
| -rw-r--r-- | dragon/assert.rb | 12 |
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 |
