Skip to content

Commit

Permalink
added argument checking, optional expected error description assertio…
Browse files Browse the repository at this point in the history
…ns, upgraded to latest qunit, and reports own version
  • Loading branch information
mmonteleone committed Oct 16, 2009
1 parent e0a594a commit 87a5df7
Show file tree
Hide file tree
Showing 6 changed files with 335 additions and 92 deletions.
10 changes: 8 additions & 2 deletions README.markdown
Expand Up @@ -344,7 +344,7 @@ Most are self-explanatory. Message parameter is always optional.
* assert(actual).isUndefined(message);
* assert.pass(message); // shortcut for assert().pass(message);
* assert.fail(message); // shortcut for assert().fail(message);
* assert(fn).throwsException(message); // asserts that executing passed fn throws an exception
* assert(fn).throwsException(expectedErrorDescription, message); // asserts that executing passed fn throws an exception (optionally with expected description)


#### Adding custom Assertions
Expand Down Expand Up @@ -435,7 +435,7 @@ Contributing

Development Requirements (for building and test running):

* Ruby + Rake and PackR gems: for building and minifying
* Ruby + Rake, PackR, rubyzip gems: for building and minifying
* Java: if you want to test using the included JsTestDriver setup

Clone the source at `http://github.com/mmonteleone/pavlov.git` and have at it.
Expand All @@ -459,6 +459,12 @@ Credit of course goes to:
Changelog
---------

* 0.2.2
- now supports `expectedErrorDescription` argument on `assert.throwsException`
- supports `rake release`
- updated to latest release of qunit
- reports own version at QUnit.specify.version
- throws proper exceptions when methods not passed expected arguments
* 0.2.1 - Updated to latest version of qunit.js/css, Fixed an IE regression in 0.2
* 0.2 - Removed Pavlov's jQuery dependence along with QUnit's independence from jQuery
* 0.1 - Initial Release
Expand Down
19 changes: 18 additions & 1 deletion Rakefile
Expand Up @@ -2,6 +2,8 @@ require 'rubygems'
require 'net/http'
require 'rake/clean'
require 'packr'
require 'zip/zip'
require 'find'
require 'fileutils'
include FileUtils

Expand All @@ -20,7 +22,7 @@ BROWSERS = [
'C:/Program Files/Opera/opera.exe' ]


desc "Builds a release"
desc "'Compiles' sources and examples together"
task :build => [:clean] do
# build dist and lib directories
mkdir 'dist'
Expand Down Expand Up @@ -57,6 +59,21 @@ task :build => [:clean] do
end
end

desc "Generates a releasable zip archive"
task :release => [:build] do
root = pwd+'/dist'
zip_archive = pwd+'/dist/Pavlov.zip'

Zip::ZipFile.open(zip_archive, Zip::ZipFile::CREATE) do |zip|
Find.find(root) do |path|
Find.prune if File.basename(path)[0] == ?.
dest = /dist\/(\w.*)/.match(path)
zip.add(dest[1],path) if dest
end
end
end



desc "Run the tests in default browser"
task :test => [:build] do
Expand Down
2 changes: 1 addition & 1 deletion lib/qunit/qunit.css
Expand Up @@ -14,4 +14,4 @@ ol#qunit-tests li strong { cursor:pointer; }
ol#qunit-tests .pass { color: green; }
ol#qunit-tests .fail { color: red; }

p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }
p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }

0 comments on commit 87a5df7

Please sign in to comment.