-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEWS-6530 Chromification #578
Changes from 13 commits
5568005
f52830f
341a81d
6d99b22
98650b6
aa9eb85
48575a3
b270fcb
546c713
601113c
b6a09f7
51f72ea
c9730e2
bf07cfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,26 @@ | |
expect(wraith.config).to include "directory" => "shots" | ||
end | ||
|
||
it 'returns default values for threads' do | ||
expect(wraith.threads).to eq 8 | ||
end | ||
it 'returns default values for timeout_ms' do | ||
expect(wraith.timeout_ms).to eq 1000 | ||
end | ||
|
||
context 'non-standard config values' do | ||
let(:config) { YAML.load "browser: phantomjs\nthreads: 2\ntimeout_ms: 4000"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't quite follow the use of YAML.load to create the object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's just easier than creating a fixture file when the contents of that file is small. |
||
let(:non_standard_wraith) { Wraith::Wraith.new( config, { yaml_passed: true }) } | ||
|
||
it 'returns overridden value when threads is specified in config' do | ||
expect(non_standard_wraith.threads).to eq 2 | ||
end | ||
|
||
it 'returns overridden value when timeout_ms is specified in config' do | ||
expect(non_standard_wraith.timeout_ms).to eq 4000 | ||
end | ||
end | ||
|
||
it "should be able to import other configs" do | ||
config_name = get_path_relative_to __FILE__, "./configs/test_config--imports.yaml" | ||
wraith = Wraith::Wraith.new(config_name) | ||
|
@@ -76,10 +96,6 @@ | |
it "include compare label" do | ||
expect(wraith.paths).to eq("home" => "/", "uk_index" => "/uk") | ||
end | ||
|
||
it "include save image threads" do | ||
expect(wraith.save_image_threads).to eq(7) | ||
end | ||
end | ||
|
||
describe "different ways of initialising browser engine" do | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ paths: | |
fuzz: '20%' | ||
|
||
# Number of threads used when saving images | ||
save_image_threads: 7 | ||
threads: 7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,4 @@ fuzz: '20%' | |
|
||
|
||
# Number of threads used when saving images | ||
save_image_threads: 7 | ||
#threads: 7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var callback = arguments[arguments.length-1]; | ||
document.body.innerHTML = " "; | ||
document.body.style['background-color'] = 'red'; | ||
callback(); | ||
(function () { | ||
document.body.innerHTML = " "; | ||
document.body.style['background-color'] = 'red'; | ||
})(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var callback = arguments[arguments.length-1]; | ||
document.body.innerHTML = " "; | ||
document.body.style['background-color'] = 'green'; | ||
callback(); | ||
(function () { | ||
document.body.innerHTML = " "; | ||
document.body.style['background-color'] = 'green'; | ||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we tidy this up? A pattern like
[opt1, opt2, ...].each |opt| options.add_argument(opt)