README.rdoc in visionmedia-jspec-2.8.4 vs README.rdoc in visionmedia-jspec-2.9.0
- old
+ new
@@ -123,13 +123,14 @@
You may alter the way JSpec operates by assigning options via the
JSpec.options hash, by passing string-based option values via the
query string, or passing a hash to run(). For example
JSpec.options.failuresOnly = true, and ?failuresOnly=1 will both work.
-* profile {bool} when enabled, uses console.time() in order to display performance information in your console log as specs are completed. (DOM, Console)
-* failuresOnly {bool} displays only failing specs, making them quick to discover and fix (DOM, Terminal)
-* reportToId {string} an element id to report to when using the DOM formatter (DOM)
+* profile {bool} when enabled, uses console.time() in order to display performance information in your console log as specs are completed. (DOM, Console)
+* failuresOnly {bool} displays only failing specs, making them quick to discover and fix (DOM, Terminal, Server)
+* reportToId {string} an element id to report to when using the DOM formatter (DOM)
+* verbose {bool} verbose server output, defaults to false (Server)
== Matchers
* Core
@@ -240,13 +241,13 @@
== Helpers
* Core
- - an_instance_of used in conjunction with the 'receive' matcher
- - mockRequest mock a request (requires jspec.xhr.js)
- - unmockRequest unmock requests (requests jspec.xhr.js)
+ - an_instance_of used in conjunction with the 'receive' matcher
+ - mockRequest, mock_request mock a request (requires jspec.xhr.js)
+ - unmockRequest, unmock_request unmock requests (requests jspec.xhr.js)
* jQuery
- sandbox used to generate new DOM sandbox, using jQuery object
- element same as invoking jQuery, just reads better and no need to worry about $ collisions
@@ -543,11 +544,10 @@
- running(options) : started running JSpec with the options passed : returning 'stop' will halt running
- loading(file) : loading a file : returning 'stop' will prevent loading
- executing(file) : executing a file : returning 'stop' will prevent execution
- posting(data, url) : posting data to a url : returning 'stop' will prevent request
- - reportingToServer(url) : reporting to server url : returning 'stop' will prevent reporting to server
- preprocessing(input) : before input string is preprocessed : return input string for next hook to preprocess
- stubbing(object, method, result) : called when stubbing an object's method, and return value (result). : (no return value)
- requiring(dependency, message) : requiring a dependency : (no return value)
- beforeAssertion(assertion) : before an assertion has been made : (no return value)
- afterAssertion(assertion) : after an assertion has been made : (no return value)
@@ -629,17 +629,39 @@
the spec suites within each browser you specify, while reporting result
back to the terminal. It is essentially the same as using the DOM formatter
and auto-testing each browser, however results are centralized to the terminal,
removing the need to manually view each browser's output.
-Initialize project with:
- $ jspec init myproject
+When utilizing the server if a file named spec/jspec.rb (or jspec/jspec.rb for rails)
+is present, then it will be loaded before the server is started. This allows you to
+add Sinatra routes, support additional Browsers, etc.
-Run with:
+Run with all supported browsers:
$ jspec run --server
+Run with specific browsers:
+ $ jspec run --browsers Safari,Firefox,Chrome,Explorer
+Run with alternative browser names:
+ $ jspec run --browsers safari,ff,chrome,ie
+
+Browsers supported in core:
+ Browser::Safari
+ Browser::Chrome
+ Browser::Opera
+ Browser::Firefox
+ Browser::IE
+
+Supplied routes:
+ /slow/NUMBER
+ /status/NUMBER
+
+For example $.get('/slow/4', function(){}) will take 4 seconds
+to reply, where as $.get('/status/404', function(){}) will respond
+with an 404 status code. Add additional Sinatra routes to the jspec.rb
+file to add your own functionality.
+
== Ruby on Rails
No additional gems are required for JSpec to work with rails, although
http://github.com/bhauman/jspec-rails has been created by 'bhauman'. JSpec
supports Rails out of the box, simply execute:
@@ -674,9 +696,13 @@
In cases such as this, you may always revert to utilizing JSpec in a grammar-less form as follows:
stub(object, 'getContentsOfURL').and_return(function(url){
return 'html'
})
+
+== Additional JSpec Modules
+
+* JSocka stubbing http://github.com/gisikw/jsocka/tree/master
== More Information
* Featured article in JSMag: http://www.jsmag.com/main.issues.description/id=21/
* Syntax comparison with other frameworks http://gist.github.com/92283