From 49b172f1922270bf4d024f9655c58a256bf31297 Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 11 Jan 2011 15:04:03 -0800 Subject: [PATCH] up with convention, down with case. pubsubhubbub now adhears to ruby caseing, rather than its own name weirdness --- app/models/jobs/publish_to_hub.rb | 2 +- lib/pubsubhubbub.rb | 2 +- spec/lib/pubsubhubbub_spec.rb | 4 ++-- spec/models/jobs/publish_to_hub_spec.rb | 2 +- spec/spec_helper.rb | 1 - 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/models/jobs/publish_to_hub.rb b/app/models/jobs/publish_to_hub.rb index 7aae4e8ec..80703d255 100644 --- a/app/models/jobs/publish_to_hub.rb +++ b/app/models/jobs/publish_to_hub.rb @@ -8,7 +8,7 @@ module Jobs @queue = :http_service def self.perform(sender_public_url) - PubSubHubbub.new(AppConfig[:pubsub_server]).publish(sender_public_url) + Pubsubhubbub.new(AppConfig[:pubsub_server]).publish(sender_public_url) end end end diff --git a/lib/pubsubhubbub.rb b/lib/pubsubhubbub.rb index 2610027cf..33f9a431b 100644 --- a/lib/pubsubhubbub.rb +++ b/lib/pubsubhubbub.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -class PubSubHubbub +class Pubsubhubbub H = {"User-Agent" => "PubSubHubbub Ruby", "Content-Type" => "application/x-www-form-urlencoded"} def initialize(hub, options={}) diff --git a/spec/lib/pubsubhubbub_spec.rb b/spec/lib/pubsubhubbub_spec.rb index 768dbe59c..f59924619 100644 --- a/spec/lib/pubsubhubbub_spec.rb +++ b/spec/lib/pubsubhubbub_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' require 'lib/pubsubhubbub' -describe PubSubHubbub do +describe Pubsubhubbub do before do RestClient.unstub!(:post) end @@ -24,7 +24,7 @@ describe PubSubHubbub do body = {'hub.url' => feed, 'hub.mode' => 'publish'} stub_request(:post, "http://hubzord.com/").to_return(:status => [202, 'you are awesome']) - PubSubHubbub.new(hub).publish(feed).code.should == 202 + Pubsubhubbub.new(hub).publish(feed).code.should == 202 end end end diff --git a/spec/models/jobs/publish_to_hub_spec.rb b/spec/models/jobs/publish_to_hub_spec.rb index b759d6b68..932bf972d 100644 --- a/spec/models/jobs/publish_to_hub_spec.rb +++ b/spec/models/jobs/publish_to_hub_spec.rb @@ -11,7 +11,7 @@ describe Jobs::PublishToHub do m = mock() m.should_receive(:publish).with(url) - PubSubHubbub.should_receive(:new).with(AppConfig[:pubsub_server]).and_return(m) + Pubsubhubbub.should_receive(:new).with(AppConfig[:pubsub_server]).and_return(m) Jobs::PublishToHub.perform(url) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7c8672584..c89609009 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,7 +29,6 @@ RSpec.configure do |config| config.before(:each) do I18n.locale = :en - EventMachine::HttpRequest.stub!(:new).and_return(FakeHttpRequest.new(:success)) RestClient.stub!(:post).and_return(FakeHttpRequest.new(:success)) DatabaseCleaner.clean