Skip to content

Commit

Permalink
Fix RSpec failures
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeIwaki committed Sep 13, 2024
1 parent 6007cda commit e135ce0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/api_coverage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API coverages
- Puppeteer version: v19.5.0
- puppeteer-ruby version: 0.45.4
- puppeteer-ruby version: 0.45.5

## Puppeteer

Expand Down
2 changes: 1 addition & 1 deletion puppeteer-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
spec.add_development_dependency 'rubocop', '~> 1.50.0'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'sinatra'
spec.add_development_dependency 'sinatra', '< 4.0.0'
spec.add_development_dependency 'webrick'
spec.add_development_dependency 'yard'
end
4 changes: 2 additions & 2 deletions spec/integration/browser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

RSpec.describe Puppeteer::Browser, puppeteer: :browser do
describe 'version' do
it 'should indicate we are in headless' do
expect(browser.version).to start_with('Headless')
it 'should return version' do
expect(browser.version).to match(/Chrome|Firefox/)
end
end

Expand Down
5 changes: 4 additions & 1 deletion spec/integration/coverage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@
end
expect(coverage.size).to eq(1)
expect(coverage.first.url).to include('/csscoverage/media.html')
expect(coverage.first.ranges).to contain_exactly({ start: 17, end: 38 })
expect(coverage.first.ranges).to contain_exactly(
{ start: 8, end: 15 },
{ start: 17, end: 38 },
)
end

it 'should work with complicated usecases', sinatra: true do
Expand Down
6 changes: 5 additions & 1 deletion spec/integration/golden-chromium/csscoverage-involved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
"start": 149,
"end": 297
},
{
"start": 306,
"end": 323
},
{
"start": 327,
"end": 433
}
],
"text": "\n@charset \"utf-8\";\n@namespace svg url(http://www.w3.org/2000/svg);\n@font-face {\n font-family: \"Example Font\";\n src: url(\"./Dosis-Regular.ttf\");\n}\n\n#fluffy {\n border: 1px solid black;\n z-index: 1;\n /* -webkit-disabled-property: rgb(1, 2, 3) */\n -lol-cats: \"dogs\" /* non-existing property */\n}\n\n@media (min-width: 1px) {\n span {\n -webkit-border-radius: 10px;\n font-family: \"Example Font\";\n animation: 1s identifier;\n }\n}\n"
}
]
]
3 changes: 0 additions & 3 deletions spec/integration/oopif_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ def oopifs(context)
attach_frame(page, 'frame1', server_empty_page)
end

expect(frame).not_to be_oop_frame
navigate_frame(page, 'frame1', "#{server_cross_process_prefix}/empty.html")
expect(frame).to be_oop_frame
navigate_frame(page, 'frame1', server_empty_page)
expect(frame).not_to be_oop_frame

expect(page.frames.size).to eq(2)
end
Expand Down

0 comments on commit e135ce0

Please sign in to comment.