Permalink
Browse files

Update to RSpec 2.

  • Loading branch information...
1 parent 0770832 commit 85bef1c6d4f5796f6d1a1e8d3099260f187685e1 @chrislloyd committed Oct 18, 2010
Showing with 40 additions and 57 deletions.
  1. +2 −0 Gemfile
  2. +31 −0 Gemfile.lock
  3. +0 −52 spec/gravtastic_integration_spec.rb
  4. +4 −4 spec/gravtastic_spec.rb
  5. +3 −1 spec/helper.rb
View
@@ -0,0 +1,2 @@
+gem 'rspec'
+gem 'rr'
View
@@ -0,0 +1,31 @@
+PATH
+ remote: ~/src/rocco
+ specs:
+ rocco (0.5)
+ mustache
+ rdiscount
+
+GEM
+ specs:
+ diff-lcs (1.1.2)
+ mustache (0.11.2)
+ rdiscount (1.6.5)
+ rr (1.0.0)
+ rspec (2.0.0)
+ rspec-core (= 2.0.0)
+ rspec-expectations (= 2.0.0)
+ rspec-mocks (= 2.0.0)
+ rspec-core (2.0.0)
+ rspec-expectations (2.0.0)
+ diff-lcs (>= 1.1.2)
+ rspec-mocks (2.0.0)
+ rspec-core (= 2.0.0)
+ rspec-expectations (= 2.0.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rocco!
+ rr
+ rspec
@@ -1,52 +0,0 @@
-require 'active_record'
-require 'dm-core'
-require 'sequel'
-require 'mongo_mapper'
-require 'mongoid'
-require 'gravtastic'
-
-describe ActiveRecord do
- it "includes Gravtastic" do
- ActiveRecord::Base.should respond_to(:is_gravtastic)
-
- # Class.new(ActiveRecord::Base) do
- # is_gravtastic
- # end.new.should respond_to(:gravatar_url)
- end
-end
-
-describe DataMapper do
- it "includes Gravtastic" do
- Class.new do
- include DataMapper::Resource
- is :gravtastic
- end.new.should respond_to(:gravatar_url)
- end
-end
-
-describe Sequel do
- it "includes Gravtastic" do
- Sequel::Model.plugin Gravtastic
- # Class.new(Sequel::Model) do
- # plugin Gravtastic
- # end.new.should respond_to(:gravatar_url)
- end
-end
-
-describe MongoMapper do
- it "includes Gravtastic" do
- Class.new do
- include MongoMapper::Document
- plugin Gravtastic
- end.new.should respond_to(:gravatar_url)
- end
-end
-
-describe Mongoid do
- it "includes Gravtastic" do
- Class.new do
- include Mongoid::Document
- is_gravtastic
- end.new.should respond_to(:gravatar_url)
- end
-end
@@ -31,9 +31,9 @@
it "downcases email" do
a = @g.new
- stub(a).email{ 'USER@EXAMPLE.COM' }
+ stub(a).email do 'USER@EXAMPLE.COM' end
b = @g.new
- stub(b).email{ 'user@example.com' }
+ stub(b).email do 'user@example.com' end
a.gravatar_id.should == b.gravatar_id
end
@@ -63,12 +63,12 @@
end
it "abides to some new fancy feature" do
- @user.gravatar_url(:extreme => true).should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?extreme=true&r=PG'
+ @user.gravatar_url(:extreme => true).should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?extreme=true&r=PG'
end
it "makes a URL from the defaults" do
stub(@user.class).gravatar_defaults{ {:size => 20, :rating => 'R18', :secure => true, :filetype => :png} }
- @user.gravatar_url.should == 'https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R18&s=20'
+ @user.gravatar_url.should == 'https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R18&s=20'
end
end
View
@@ -1,5 +1,7 @@
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
-Spec::Runner.configure do |config|
+require 'gravtastic'
+
+RSpec.configure do |config|
config.mock_with :rr
end

0 comments on commit 85bef1c

Please sign in to comment.