fix some code styling issues
This commit is contained in:
@@ -64,7 +64,7 @@ describe Browser do
|
||||
|
||||
it 'raises an error' do
|
||||
File.symlink('./testfile', config_file)
|
||||
expect { browser.load_config(config_file) }.to raise_error("[ERROR] Config file is a symlink.")
|
||||
expect { browser.load_config(config_file) }.to raise_error('[ERROR] Config file is a symlink.')
|
||||
File.unlink(config_file)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -92,7 +92,7 @@ describe CacheFileStore do
|
||||
it 'should create a unique storage dir' do
|
||||
storage_dirs = []
|
||||
|
||||
(1..5).each do |i|
|
||||
(1..5).each do |_|
|
||||
storage_dirs << CacheFileStore.new(cache_dir).storage_path
|
||||
end
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ describe 'WpTheme::Findable' do
|
||||
end
|
||||
end
|
||||
|
||||
stub_all_to_nil()
|
||||
stub_all_to_nil
|
||||
|
||||
expect { WpTheme.find(uri) }.to_not raise_error
|
||||
end
|
||||
@@ -129,7 +129,7 @@ describe 'WpTheme::Findable' do
|
||||
|
||||
context 'when the theme is not found' do
|
||||
it 'returns nil' do
|
||||
stub_all_to_nil()
|
||||
stub_all_to_nil
|
||||
|
||||
expect(WpTheme.find(uri)).to be_nil
|
||||
end
|
||||
@@ -137,7 +137,7 @@ describe 'WpTheme::Findable' do
|
||||
|
||||
context 'when the theme is found' do
|
||||
it 'returns it, with the :found_from set' do
|
||||
stub_all_to_nil()
|
||||
stub_all_to_nil
|
||||
stub_request(:get, /.+\/the-oracle\/style.css$/).to_return(status: 200)
|
||||
expected = WpTheme.new(uri, name: 'the-oracle')
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ describe 'WpVersion::Findable' do
|
||||
|
||||
context 'when no version found' do
|
||||
it 'returns nil' do
|
||||
stub_all_to_nil()
|
||||
stub_all_to_nil
|
||||
@expected = nil
|
||||
end
|
||||
end
|
||||
@@ -188,8 +188,8 @@ describe 'WpVersion::Findable' do
|
||||
found_from = method[/^find_from_(.*)/, 1].sub('_', ' ')
|
||||
|
||||
context "when found from #{found_from}" do
|
||||
it "returns the correct WpVersion" do
|
||||
stub_all_to_nil()
|
||||
it 'returns the correct WpVersion' do
|
||||
stub_all_to_nil
|
||||
|
||||
allow(WpVersion).to receive(method).and_return(number)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ describe 'WebSite' do
|
||||
)
|
||||
end
|
||||
|
||||
describe "#new" do
|
||||
describe '#new' do
|
||||
its(:url) { is_expected.to be === 'http://example.localhost/' }
|
||||
end
|
||||
|
||||
@@ -68,14 +68,14 @@ describe 'WebSite' do
|
||||
|
||||
describe '#xml_rpc_url' do
|
||||
it 'returns the xmlrpc url' do
|
||||
expect(web_site.xml_rpc_url).to be === "http://example.localhost/xmlrpc.php"
|
||||
expect(web_site.xml_rpc_url).to be === 'http://example.localhost/xmlrpc.php'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#has_xml_rpc?' do
|
||||
it 'returns true' do
|
||||
stub_request(:get, web_site.xml_rpc_url).
|
||||
to_return(status: 200, body: "XML-RPC server accepts POST requests only")
|
||||
to_return(status: 200, body: 'XML-RPC server accepts POST requests only')
|
||||
|
||||
expect(web_site).to have_xml_rpc
|
||||
end
|
||||
|
||||
@@ -149,7 +149,7 @@ describe WpTarget do
|
||||
|
||||
after :each do
|
||||
allow(wp_target).to receive_messages(wp_content_dir: 'wp-content')
|
||||
stub_request_to_fixture(url: wp_target.debug_log_url(), fixture: @fixture)
|
||||
stub_request_to_fixture(url: wp_target.debug_log_url, fixture: @fixture)
|
||||
expect(wp_target.has_debug_log?).to be === @expected
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user