spec/lib/percy/capybara/loaders/filesystem_loader_spec.rb in percy-capybara-2.4.0 vs spec/lib/percy/capybara/loaders/filesystem_loader_spec.rb in percy-capybara-2.4.1
- old
+ new
@@ -16,11 +16,11 @@
it 'raises an error' do
expect { loader }.to raise_error(ArgumentError)
end
end
context 'assets_dir doesn\'t exist' do
- let(:assets_dir) { File.expand_path("../../client/testdata-doesnt-exist", __FILE__) }
+ let(:assets_dir) { File.expand_path('../../client/testdata-doesnt-exist', __FILE__) }
it 'raises an error' do
expect { loader }.to raise_error(ArgumentError)
end
end
end
@@ -40,13 +40,16 @@
end
describe '#build_resources' do
context 'assets_dir including all test files' do
it 'returns all included assets as resources' do
- actual_paths = loader.build_resources.collect { |resource| resource.path.gsub(assets_dir, '') }
+ actual_paths = loader.build_resources.collect do |resource|
+ resource.path.gsub(assets_dir, '')
+ end
expected_paths = [
- '/assets/css/digested-f3420c6aee71c137a3ca39727052811bae84b2f37d898f4db242e20656a1579e.css',
+ '/assets/css/digested-f3420c6aee71c137a3ca39727052811ba' \
+ 'e84b2f37d898f4db242e20656a1579e.css',
'/css/base.css',
'/css/digested.css',
'/css/imports.css',
'/css/level0-imports.css',
'/css/level1-imports.css',
@@ -70,12 +73,13 @@
'/test-images.html',
'/test-localtest-me-images.html',
]
expect(actual_paths).to eq(expected_paths)
- expected_urls = loader.build_resources.collect { |resource| resource.resource_url }
+ expected_urls = loader.build_resources.collect(&:resource_url)
actual_urls = [
- '/url-prefix/assets/css/digested-f3420c6aee71c137a3ca39727052811bae84b2f37d898f4db242e20656a1579e.css',
+ '/url-prefix/assets/css/digested-f3420c6aee71c137a3ca' \
+ '39727052811bae84b2f37d898f4db242e20656a1579e.css',
'/url-prefix/css/base.css',
'/url-prefix/css/digested.css',
'/url-prefix/css/imports.css',
'/url-prefix/css/level0-imports.css',
'/url-prefix/css/level1-imports.css',