Created
January 20, 2009 21:25
-
-
Save gma/49674 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
poncho (sinatra-09)% ruby spec/sitemap_spec.rb -e 'should have a urlset tag' | |
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31: warning: The :env option is deprecated; use :environment instead. | |
F | |
1) | |
ArgumentError in 'sitemap XML should have a urlset tag' | |
tried to create Proc object without a block | |
/Library/Ruby/Gems/1.8/gems/sinatra-0.9.0.2/lib/sinatra/base.rb:589:in `define_method' | |
/Library/Ruby/Gems/1.8/gems/sinatra-0.9.0.2/lib/sinatra/base.rb:589:in `route' | |
/Library/Ruby/Gems/1.8/gems/sinatra-0.9.0.2/lib/sinatra/base.rb:569:in `get' | |
(__DELEGATE__):2:in `get' | |
spec/sitemap_spec.rb:11: | |
spec/sitemap_spec.rb:56: | |
Finished in 0.012056 seconds | |
1 example, 1 failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.join(File.dirname(__FILE__), "spec_helper") | |
describe "sitemap XML" do | |
include ModelFactory | |
include SpecHelper | |
before(:each) do | |
stub_configuration | |
create_category { |f| mock_file_stat(:stub!, f, "3 Jan 2009, 15:07") } | |
create_article { |f| mock_file_stat(:stub!, f, "3 Jan 2009, 15:10") } | |
get "/sitemap.xml" | |
end | |
after(:each) do | |
remove_fixtures | |
end | |
it "should render successfully" do | |
@response.should be_ok | |
end | |
it "should have a urlset tag" do | |
namespace = "http://www.sitemaps.org/schemas/sitemap/0.9" | |
body.should have_tag("/urlset[@xmlns=#{namespace}]") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "spec" | |
require "sinatra" | |
require "sinatra/test/rspec" | |
require "rspec_hpricot_matchers" | |
Spec::Runner.configure do |config| | |
config.include(RspecHpricotMatchers) | |
end | |
set :views => File.join(File.dirname(__FILE__), "..", "views"), | |
:public => File.join(File.dirname(__FILE__), "..", "public") | |
ENV["RACK_ENV"] = "test" | |
require File.join(File.dirname(__FILE__), "model_factory") | |
require File.join(File.dirname(__FILE__), "..", "app") | |
module SpecHelper | |
def body | |
@response.body | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment