Skip to content

Commit

Permalink
Update to latest beta of Rails and RSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeric committed Apr 30, 2010
1 parent ee5a295 commit 682b1b9
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 29 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source :gemcutter

# Rails 3.0
gem 'rails', '3.0.0.beta2'
gem 'rspec', '2.0.0.beta.5'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
gem 'rails', '3.0.0.beta3'
gem 'rspec', '2.0.0.beta.8'
gem 'sqlite3-ruby', :require => 'sqlite3'
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe "Acts As Taggable On" do
before(:each) do
Expand Down
6 changes: 3 additions & 3 deletions spec/acts_as_taggable_on/acts_as_tagger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe "acts_as_tagger" do
before(:each) do
clean_database!
end

context "Tagger Method Generation" do
describe "Tagger Method Generation" do
before(:each) do
@tagger = TaggableUser.new()
end
Expand Down Expand Up @@ -84,7 +84,7 @@
end
end

context "when called by multiple tagger's" do
describe "when called by multiple tagger's" do
before(:each) do
@user_x = TaggableUser.create(:name => "User X")
@user_y = TaggableUser.create(:name => "User Y")
Expand Down
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/tag_list_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe TagList do
before(:each) do
Expand Down
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/tag_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe Tag do
before(:each) do
Expand Down
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/taggable_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe "Taggable" do
before(:each) do
Expand Down
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/tagger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe "Tagger" do
before(:each) do
Expand Down
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/tagging_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe Tagging do
before(:each) do
Expand Down
2 changes: 1 addition & 1 deletion spec/acts_as_taggable_on/tags_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
require File.expand_path('../../spec_helper', __FILE__)

describe TagsHelper do
before(:each) do
Expand Down
36 changes: 20 additions & 16 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
$LOAD_PATH << "." unless $LOAD_PATH.include?(".")

begin
# Try to require the preresolved locked set of gems.
require File.expand_path("../.bundle/environment", __FILE__)
rescue LoadError
# Fall back on doing an unlocked resolve at runtime.
require "rubygems" unless RUBY_VERSION >= "1.9"
require "rubygems"
require "bundler"

if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.5")
raise RuntimeError, "Your bundler version is too old." +
"Run `gem install bundler` to upgrade."
end

# Set up load paths for all bundled gems
Bundler.setup
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"
end

Bundler.require
require File.expand_path('../../lib/acts-as-taggable-on', __FILE__)

if defined?(Rspec::Core::ExampleGroupSubject)
module Rspec::Core::ExampleGroupSubject
alias :context :describe
end
end

class Array
def freq
k=Hash.new(0)
each {|e| k[e]+=1}
k
unless [].respond_to?(:freq)
class Array
def freq
k=Hash.new(0)
each {|e| k[e]+=1}
k
end
end
end

Expand Down

0 comments on commit 682b1b9

Please sign in to comment.