mirror of
https://github.com/Fishwaldo/role_model.git
synced 2025-03-15 19:42:43 +00:00
update to RSpec 2, latest jeweler + bundler
This commit is contained in:
parent
3fe3a6d535
commit
bb34024aad
6 changed files with 79 additions and 32 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -13,9 +13,13 @@ tmtags
|
|||
## VIM
|
||||
*.swp
|
||||
|
||||
## BUNDLE
|
||||
.bundle
|
||||
|
||||
## PROJECT::GENERAL
|
||||
coverage
|
||||
rdoc
|
||||
pkg
|
||||
|
||||
## PROJECT::SPECIFIC
|
||||
.rvmrc
|
||||
|
|
7
Gemfile
Normal file
7
Gemfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
source 'http://rubygems.org'
|
||||
|
||||
group :development do
|
||||
gem 'jeweler', '>=1.5.2'
|
||||
gem 'rspec', '~> 2'
|
||||
gem 'autotest'
|
||||
end
|
29
Gemfile.lock
Normal file
29
Gemfile.lock
Normal file
|
@ -0,0 +1,29 @@
|
|||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
ZenTest (4.5.0)
|
||||
autotest (4.4.6)
|
||||
ZenTest (>= 4.4.1)
|
||||
diff-lcs (1.1.2)
|
||||
git (1.2.5)
|
||||
jeweler (1.5.2)
|
||||
bundler (~> 1.0.0)
|
||||
git (>= 1.2.5)
|
||||
rake
|
||||
rake (0.8.7)
|
||||
rspec (2.5.0)
|
||||
rspec-core (~> 2.5.0)
|
||||
rspec-expectations (~> 2.5.0)
|
||||
rspec-mocks (~> 2.5.0)
|
||||
rspec-core (2.5.1)
|
||||
rspec-expectations (2.5.0)
|
||||
diff-lcs (~> 1.1.2)
|
||||
rspec-mocks (2.5.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
autotest
|
||||
jeweler (>= 1.5.2)
|
||||
rspec (~> 2)
|
43
Rakefile
43
Rakefile
|
@ -1,40 +1,43 @@
|
|||
require 'rubygems'
|
||||
require 'bundler'
|
||||
begin
|
||||
Bundler.setup(:default, :development)
|
||||
rescue Bundler::BundlerError => e
|
||||
$stderr.puts e.message
|
||||
$stderr.puts "Run `bundle install` to install missing gems"
|
||||
exit e.status_code
|
||||
end
|
||||
require 'rake'
|
||||
|
||||
begin
|
||||
require 'jeweler'
|
||||
Jeweler::Tasks.new do |gem|
|
||||
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
||||
gem.name = "role_model"
|
||||
gem.homepage = "http://github.com/martinrehfeld/role_model"
|
||||
gem.license = "MIT"
|
||||
gem.summary = %Q{Declare, assign and query roles with ease}
|
||||
gem.description = %Q{Ever needed to assign roles to a model, say a User, and build conditional behaviour on top of that? Enter RoleModel -- roles have never been easier! Just declare your roles and you are done. Assigned roles will be stored as a bitmask.}
|
||||
gem.email = "martin.rehfeld@glnetworks.de"
|
||||
gem.homepage = "http://github.com/martinrehfeld/role_model"
|
||||
gem.authors = ["Martin Rehfeld"]
|
||||
gem.add_development_dependency "rspec", ">= 1.2.9"
|
||||
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
||||
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
||||
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
||||
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
||||
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
||||
gem.add_development_dependency "rspec", "~> 2"
|
||||
end
|
||||
Jeweler::GemcutterTasks.new
|
||||
rescue LoadError
|
||||
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
||||
Jeweler::RubygemsDotOrgTasks.new
|
||||
|
||||
require 'rspec/core'
|
||||
require 'rspec/core/rake_task'
|
||||
RSpec::Core::RakeTask.new(:spec) do |spec|
|
||||
spec.pattern = FileList['spec/**/*_spec.rb']
|
||||
end
|
||||
|
||||
require 'spec/rake/spectask'
|
||||
Spec::Rake::SpecTask.new(:spec) do |spec|
|
||||
spec.libs << 'lib' << 'spec'
|
||||
spec.spec_files = FileList['spec/**/*_spec.rb']
|
||||
end
|
||||
|
||||
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
||||
spec.libs << 'lib' << 'spec'
|
||||
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
||||
spec.pattern = 'spec/**/*_spec.rb'
|
||||
spec.rcov = true
|
||||
spec.rcov_opts.concat ['--exclude', 'rcov.rb']
|
||||
spec.rcov_opts.concat ['--exclude', '.*_spec.rb']
|
||||
spec.rcov_opts.concat ['--exclude', 'spec_helper.rb']
|
||||
end
|
||||
|
||||
task :spec => :check_dependencies
|
||||
|
||||
task :default => :spec
|
||||
|
||||
require 'rake/rdoctask'
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
||||
require 'rspec'
|
||||
require File.dirname(__FILE__) + '/custom_matchers'
|
||||
require 'role_model'
|
||||
require 'spec'
|
||||
require 'spec/autorun'
|
||||
require File.dirname(__FILE__) + "/custom_matchers"
|
||||
|
||||
Spec::Runner.configure do |config|
|
||||
RSpec.configure do |config|
|
||||
config.include(CustomMatchers)
|
||||
config.mock_with :rspec
|
||||
end
|
||||
|
||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||
# in spec/support/ and its subdirectories.
|
||||
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each {|f| require f}
|
||||
|
|
Loading…
Add table
Reference in a new issue