Skip to content

Commit

Permalink
Fix to pass specs with rspec-mocks 3.10.3 (#407)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuki Takahashi <yuki.takahashi.b@mixi.co.jp>
  • Loading branch information
kjvarga and tkhsh committed Aug 9, 2022
1 parent 6116b78 commit 0335038
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions spec/sitemap_generator/builder/sitemap_file_spec.rb
Expand Up @@ -97,13 +97,13 @@
describe 'add' do
it 'should use the host provided' do
url = SitemapGenerator::Builder::SitemapUrl.new('/one', :host => 'http://newhost.com/')
expect(SitemapGenerator::Builder::SitemapUrl).to receive(:new).with('/one', hash_including(:host => 'http://newhost.com')).and_return(url)
expect(SitemapGenerator::Builder::SitemapUrl).to receive(:new).with('/one', { :host => 'http://newhost.com' }).and_return(url)
sitemap.add '/one', :host => 'http://newhost.com'
end

it 'should use the host from the location' do
url = SitemapGenerator::Builder::SitemapUrl.new('/one', :host => 'http://example.com/')
expect(SitemapGenerator::Builder::SitemapUrl).to receive(:new).with('/one', hash_including(:host => 'http://example.com/')).and_return(url)
expect(SitemapGenerator::Builder::SitemapUrl).to receive(:new).with('/one', { :host => 'http://example.com/' }).and_return(url)
sitemap.add '/one'
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/sitemap_generator/builder/sitemap_index_file_spec.rb
Expand Up @@ -75,13 +75,13 @@
describe 'add' do
it 'should use the host provided' do
url = SitemapGenerator::Builder::SitemapIndexUrl.new('/one', :host => 'http://newhost.com/')
expect(SitemapGenerator::Builder::SitemapIndexUrl).to receive(:new).with('/one', hash_including(:host => 'http://newhost.com')).and_return(url)
expect(SitemapGenerator::Builder::SitemapIndexUrl).to receive(:new).with('/one', { :host => 'http://newhost.com' }).and_return(url)
index.add '/one', :host => 'http://newhost.com'
end

it 'should use the host from the location' do
url = SitemapGenerator::Builder::SitemapIndexUrl.new('/one', :host => 'http://example.com/')
expect(SitemapGenerator::Builder::SitemapIndexUrl).to receive(:new).with('/one', hash_including(:host => 'http://example.com/')).and_return(url)
expect(SitemapGenerator::Builder::SitemapIndexUrl).to receive(:new).with('/one', { :host => 'http://example.com/' }).and_return(url)
index.add '/one'
end

Expand Down
6 changes: 3 additions & 3 deletions spec/sitemap_generator/interpreter_spec.rb
Expand Up @@ -35,14 +35,14 @@
describe 'public interface' do
describe 'add' do
it 'should add a link to the sitemap' do
expect(link_set).to receive(:add).with('test', hash_including(:option => 'value'))
expect(link_set).to receive(:add).with('test', { :option => 'value' })
interpreter.add('test', :option => 'value')
end
end

describe 'group' do
it 'should start a new group' do
expect(link_set).to receive(:group).with('test', hash_including(:option => 'value'))
expect(link_set).to receive(:group).with('test', { :option => 'value' })
interpreter.group('test', :option => 'value')
end
end
Expand All @@ -55,7 +55,7 @@

describe 'add_to_index' do
it 'should add a link to the sitemap index' do
expect(link_set).to receive(:add_to_index).with('test', hash_including(:option => 'value'))
expect(link_set).to receive(:add_to_index).with('test', { :option => 'value' })
interpreter.add_to_index('test', :option => 'value')
end
end
Expand Down
10 changes: 5 additions & 5 deletions spec/sitemap_generator/link_set_spec.rb
Expand Up @@ -679,13 +679,13 @@

it 'should add the link to the sitemap and include the default host' do
expect(ls).to receive(:add_default_links)
expect(ls.sitemap).to receive(:add).with('/home', hash_including(:host => ls.default_host))
expect(ls.sitemap).to receive(:add).with('/home', { :host => ls.default_host })
ls.add('/home')
end

it 'should allow setting of a custom host' do
expect(ls).to receive(:add_default_links)
expect(ls.sitemap).to receive(:add).with('/home', hash_including(:host => 'http://newhost.com'))
expect(ls.sitemap).to receive(:add).with('/home', { :host => 'http://newhost.com' })
ls.add('/home', :host => 'http://newhost.com')
end

Expand All @@ -710,17 +710,17 @@
describe 'host' do
it 'should be the sitemaps_host' do
ls.sitemaps_host = 'http://sitemapshost.com'
expect(ls.sitemap_index).to receive(:add).with('/home', hash_including(:host => 'http://sitemapshost.com'))
expect(ls.sitemap_index).to receive(:add).with('/home', { :host => 'http://sitemapshost.com' })
ls.add_to_index('/home')
end

it 'should be the default_host if no sitemaps_host set' do
expect(ls.sitemap_index).to receive(:add).with('/home', hash_including(:host => ls.default_host))
expect(ls.sitemap_index).to receive(:add).with('/home', { :host => ls.default_host })
ls.add_to_index('/home')
end

it 'should allow setting a custom host' do
expect(ls.sitemap_index).to receive(:add).with('/home', hash_including(:host => 'http://newhost.com'))
expect(ls.sitemap_index).to receive(:add).with('/home', { :host => 'http://newhost.com' })
ls.add_to_index('/home', :host => 'http://newhost.com')
end
end
Expand Down

0 comments on commit 0335038

Please sign in to comment.