Uses Pathname#join rather than File#join when possible
This commit is contained in:
@@ -2,10 +2,10 @@ describe WPScan::Finders::ThemeVersion::Style do
|
||||
subject(:finder) { described_class.new(theme) }
|
||||
let(:theme) { WPScan::Theme.new('spec', target) }
|
||||
let(:target) { WPScan::Target.new('http://wp.lab/') }
|
||||
let(:fixtures) { File.join(FINDERS_FIXTURES, 'theme_version', 'style') }
|
||||
let(:fixtures) { FINDERS_FIXTURES.join('theme_version', 'style') }
|
||||
|
||||
before :all do
|
||||
Typhoeus::Config.cache = WPScan::Cache::Typhoeus.new(File.join(SPECS, 'cache'))
|
||||
Typhoeus::Config.cache = WPScan::Cache::Typhoeus.new(SPECS.join('cache'))
|
||||
end
|
||||
|
||||
before do
|
||||
@@ -77,7 +77,7 @@ describe WPScan::Finders::ThemeVersion::Style do
|
||||
'no_version' => nil
|
||||
}.each do |file, expected_version|
|
||||
context "when #{file}" do
|
||||
let(:style_body) { File.new(File.join(fixtures, "#{file}.css")) }
|
||||
let(:style_body) { File.new(fixtures.join("#{file}.css")) }
|
||||
|
||||
it 'returns the expected version' do
|
||||
expected = if expected_version
|
||||
|
||||
@@ -2,7 +2,7 @@ describe WPScan::Finders::ThemeVersion::WooFrameworkMetaGenerator do
|
||||
subject(:finder) { described_class.new(theme) }
|
||||
let(:theme) { WPScan::Theme.new(slug, target) }
|
||||
let(:target) { WPScan::Target.new('http://wp.lab/') }
|
||||
let(:fixtures) { File.join(FINDERS_FIXTURES, 'theme_version', 'woo_framework_meta_generator') }
|
||||
let(:fixtures) { FINDERS_FIXTURES.join('theme_version', 'woo_framework_meta_generator') }
|
||||
|
||||
before do
|
||||
expect(target).to receive(:content_dir).and_return('wp-content')
|
||||
@@ -11,7 +11,7 @@ describe WPScan::Finders::ThemeVersion::WooFrameworkMetaGenerator do
|
||||
|
||||
describe '#passive' do
|
||||
after do
|
||||
stub_request(:get, target.url).to_return(body: File.read(File.join(fixtures, 'editorial-1.3.5.html')))
|
||||
stub_request(:get, target.url).to_return(body: File.read(fixtures.join('editorial-1.3.5.html')))
|
||||
|
||||
expect(finder.passive).to eql @expected
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user