Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding Gemfile, to get specs running just bundle and rake - closes #163

  • Loading branch information...
commit 18b45d5cfc5e6c795724bae648068b69d0420aed 1 parent 8f49f28
@ryanb authored
View
2  .gitignore
@@ -1 +1,3 @@
*.gem
+Gemfile.lock
+.bundle
View
1  .rspec
@@ -0,0 +1 @@
+--color
View
2  Gemfile
@@ -0,0 +1,2 @@
+source "http://rubygems.org"
+gemspec
View
8 README.rdoc
@@ -147,6 +147,14 @@ This will only work when abilities are defined using hash conditions, not blocks
* {Admin Namespace}[http://wiki.github.com/ryanb/cancan/admin-namespace]
* {See more}[http://wiki.github.com/ryanb/cancan/]
+
+== Questions or Problems?
+
+If you have any issues with CanCan which you cannot find the solution to in the documentation, please add an {issue on GitHub}. Or better yet, fork the project and make a pull request.
+
+To get the specs running you should call +bundle+ and then +rake+. Specs currently do not work in Ruby 1.9 due to the RR mocking framework.
+
+
== Special Thanks
CanCan was inspired by declarative_authorization[http://github.com/stffn/declarative_authorization/] and aegis[http://github.com/makandra/aegis]. Also many thanks to the CanCan contributors[http://github.com/ryanb/cancan/contributors]. See the CHANGELOG[http://github.com/ryanb/cancan/blob/master/CHANGELOG.rdoc] for the full list.
View
11 Rakefile
@@ -1,13 +1,10 @@
require 'rubygems'
require 'rake'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
-spec_files = Rake::FileList["spec/**/*_spec.rb"]
-
-desc "Run specs"
-Spec::Rake::SpecTask.new do |t|
- t.spec_files = spec_files
- t.spec_opts = ["-c"]
+desc "Run RSpec"
+RSpec::Core::RakeTask.new do |t|
+ t.verbose = false
end
task :default => :spec
View
4 cancan.gemspec
@@ -10,6 +10,10 @@ Gem::Specification.new do |s|
s.files = Dir["{lib,spec}/**/*", "[A-Z]*", "init.rb"]
s.require_path = "lib"
+ s.add_development_dependency 'rspec', '~> 2.0.0.beta.22'
+ s.add_development_dependency 'rails', '~> 3.0.0'
+ s.add_development_dependency 'rr', '~> 0.10.11' # 1.0.0 has respond_to? issues: http://github.com/btakita/rr/issues/issue/43
+
s.rubyforge_project = s.name
s.required_rubygems_version = ">= 1.3.4"
end
View
2  spec/cancan/ability_spec.rb
@@ -379,7 +379,7 @@ class A; include B; end
end
it "should have variables for action and subject" do
- I18n.backend.store_translations :en, :unauthorized => {:manage => {:all => "{{action}} {{subject}}"}} # old syntax for now in case testing with old I18n
+ I18n.backend.store_translations :en, :unauthorized => {:manage => {:all => "%{action} %{subject}"}} # old syntax for now in case testing with old I18n
@ability.unauthorized_message(:update, Array).should == "update array"
@ability.unauthorized_message(:edit, 1..3).should == "edit range"
end
View
2  spec/matchers.rb
@@ -1,4 +1,4 @@
-Spec::Matchers.define :orderlessly_match do |original_string|
+RSpec::Matchers.define :orderlessly_match do |original_string|
match do |given_string|
original_string.split('').sort == given_string.split('').sort
end
View
10 spec/spec_helper.rb
@@ -1,14 +1,12 @@
require 'rubygems'
-require 'spec'
-require 'active_support'
-require 'active_record'
-require 'action_controller'
-require 'action_view'
+require 'bundler'
+Bundler.require(:default, :test)
+require 'active_support/all'
require 'matchers'
require 'cancan'
require 'cancan/matchers'
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
config.mock_with :rr
end

0 comments on commit 18b45d5

Please sign in to comment.
Something went wrong with that request. Please try again.