Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,14 @@ use_phantom_gem: false
```

This will then try and use the `phantom` executable on the current `PATH`.

## PhantomJS command-line options

If you want to pass command-line options to phantomjs executable, you can set:

```yml
phantom_options: --web-security=no
```

This will pass everything defined on `phantom_options` as
[options](http://phantomjs.org/api/command-line.html).
4 changes: 4 additions & 0 deletions lib/jasmine-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ def use_phantom_gem?
jasmine_config['use_phantom_gem'].nil? || jasmine_config['use_phantom_gem'] == true
end

def phantom_options
jasmine_config['phantom_options'].to_s.strip
end

private

def css_dir
Expand Down
3 changes: 2 additions & 1 deletion lib/jasmine_rails/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def run(spec_filter = nil, reporters = 'console')

phantomjs_runner_path = File.join(File.dirname(__FILE__), '..', 'assets', 'javascripts', 'jasmine-runner.js')
phantomjs_cmd = JasmineRails.use_phantom_gem? ? Phantomjs.path : 'phantomjs'
run_cmd %{"#{phantomjs_cmd}" "#{phantomjs_runner_path}" "file://#{runner_path.to_s}?spec=#{spec_filter}"}
phantomjs_opts = JasmineRails.phantom_options
run_cmd %{"#{phantomjs_cmd}" "#{phantomjs_opts}" "#{phantomjs_runner_path}" "file://#{runner_path.to_s}?spec=#{spec_filter}"}
end
end

Expand Down