![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
rspec-sitemap-matchers
Advanced tools
Sitemap protocol matchers for RSpec.
Sitemaps are an easy way to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site.
Add this line to your application's Gemfile:
gem 'rspec-sitemap-matchers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec-sitemap-matchers
These matchers are not loaded by default in order not to pollute the global RSpec matcher namespace and consequentially to be able to specify in which context you would want to make use of them.
You can load them globally via your spec_helper
(not recommended):
RSpec.configure do |config|
config.include RSpec::Sitemap::Matchers
end
… or include RSpec::Sitemap::Matchers
in an individual spec file (preferred way).
These matchers can be used on File
s, String
s and any arbitary IO
instance that has a :read
method:
describe "My Sitemap" do
subject { File.open(Rails.root + 'tmp' + 'sitemap.xml') }
it { should include_url("http://www.example.com") }
it { should_not include_url("http://www.a-different-example.com") }
end
The matchers also support more specific attribution matching, such as priorities as per the Sitemap protocol. These can be chained together:
it { should include_url('http://www.example.com').priority(0.5) }
it { should include_url('http://www.example.com').changefreq('weekly') }
it { should include_url('http://www.example.com').lastmod('2012-07-16T19:20+01:00') }
Note: You can chanin multiple attribute matchers together, like .lastod('…').changefreq('…')
etc.
be_a_valid_sitemap
matchergit checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright © 2012 Attila Györffy, Unboxed Consulting and contributors. See LICENSE for details.
FAQs
Unknown package
We found that rspec-sitemap-matchers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.