jasmine-mozrepl/README.md

26 lines
920 B
Markdown
Raw Normal View History

2018-05-30 04:00:52 +00:00
Reload [Jasmine](https://jasmine.github.io/) test suites in Firefox using [MozRepl](https://github.com/bard/mozrepl) and this lovely gem.
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
Use it with **watchr**:
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
require 'jasmine-mozrepl'
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
extend Jasmine::MozRepl
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
watch('public/javascript/.*\.js') { do_reload }
watch('spec/javascripts/.*_spec\.js') { do_reload }
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
def do_reload
system %{growlnotify -m "#{repl_reload(:echo_to_console => true)}" -t "Jasmine suite"}
end
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
do_reload
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
**repl_reload** options:
2011-02-18 16:53:03 +00:00
2011-02-18 16:57:36 +00:00
* **:host** is the host to connect to *(default: 127.0.0.1)*
2011-02-18 17:15:14 +00:00
* **:port** is the post to connect to *(default: 4242)*
2011-02-18 16:57:36 +00:00
* **:jasmine_matcher** is the address in the address bar to search for *(default: "localhost:8888")*
* **:echo_to_console** writes the success/failure message to the console in red/green *(default: false)*
**repl_reload** returns the success/failure count message from Jasmine so you can use it as you wish.