Skip to content

Commit

Permalink
Created shoulda metagem
Browse files Browse the repository at this point in the history
  • Loading branch information
jferris committed Jan 19, 2011
1 parent c482786 commit 46076d5
Show file tree
Hide file tree
Showing 162 changed files with 26 additions and 14,398 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Expand Up @@ -2,8 +2,7 @@ source 'http://rubygems.org'

gem 'rails', '3.0.3'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'mocha'
gem 'rspec-rails'
gem 'rspec'
gem 'ruby-debug'
gem 'cucumber'
gem "aruba"
Expand Down
10 changes: 1 addition & 9 deletions Gemfile.lock
Expand Up @@ -56,8 +56,6 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mocha (0.9.10)
rake
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
Expand Down Expand Up @@ -86,11 +84,6 @@ GEM
rspec-expectations (2.3.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.3.0)
rspec-rails (2.3.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.3.0)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
Expand All @@ -109,8 +102,7 @@ PLATFORMS
DEPENDENCIES
aruba
cucumber
mocha
rails (= 3.0.3)
rspec-rails
rspec
ruby-debug
sqlite3-ruby
32 changes: 4 additions & 28 deletions Rakefile
@@ -1,37 +1,13 @@
require 'rubygems'
require 'bundler/setup'
require 'rake'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'

$LOAD_PATH.unshift("lib")
require 'shoulda/matchers/version'
require 'shoulda/version'

Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
rdoc.options << '--line-numbers'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
}

RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/**/*_spec.rb"
t.rspec_opts = '--color --format progress'
t.verbose = false
end

desc "Run code-coverage analysis using rcov"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.rspec_opts = '--color --format progress'
t.rcov = true
t.rcov_opts = %{--exclude osx\/objc,spec,gems\/ --failure-threshold 100}
t.pattern = "spec/**/*_spec.rb"
end

eval("$specification = begin; #{IO.read('shoulda-matchers.gemspec')}; end")
eval("$specification = begin; #{IO.read('shoulda.gemspec')}; end")
Rake::GemPackageTask.new $specification do |pkg|
pkg.need_tar = true
pkg.need_zip = true
Expand All @@ -45,6 +21,6 @@ Cucumber::Rake::Task.new do |t|
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
end

desc 'Default: run specs and cucumber features'
task :default => [:spec, :cucumber]
desc 'Default: run cucumber features'
task :default => [:cucumber]

4 changes: 2 additions & 2 deletions features/rails_integration.feature
Expand Up @@ -33,7 +33,7 @@ Feature: integrate with Rails

Scenario: generate a rails application and use matchers in Test::Unit
When I configure the application to use shoulda-context
And I configure the application to use "shoulda-matchers" from this project
When I configure the application to use shoulda-matchers
And I write to "test/unit/user_test.rb" with:
"""
require 'test_helper'
Expand Down Expand Up @@ -63,7 +63,7 @@ Feature: integrate with Rails

Scenario: generate a rails application and use matchers in Rspec
When I configure the application to use rspec-rails
And I configure the application to use "shoulda-matchers" from this project
And I configure the application to use shoulda-matchers
And I run the rspec generator
And I write to "spec/models/user_spec.rb" with:
"""
Expand Down
5 changes: 5 additions & 0 deletions features/step_definitions/rails_steps.rb
Expand Up @@ -36,6 +36,11 @@
steps %{And I run "bundle install --local"}
end

When /^I configure the application to use shoulda-matchers$/ do
append_to_gemfile "gem 'shoulda-matchers', :git => 'git@github.com:thoughtbot/shoulda-matchers.git'"
steps %{And I run "bundle install --local"}
end

When /^I configure a wildcard route$/ do
steps %{
When I write to "config/routes.rb" with:
Expand Down
8 changes: 0 additions & 8 deletions lib/shoulda-matchers.rb

This file was deleted.

38 changes: 0 additions & 38 deletions lib/shoulda/matchers/action_controller.rb

This file was deleted.

114 changes: 0 additions & 114 deletions lib/shoulda/matchers/action_controller/assign_to_matcher.rb

This file was deleted.

50 changes: 0 additions & 50 deletions lib/shoulda/matchers/action_controller/filter_param_matcher.rb

This file was deleted.

62 changes: 0 additions & 62 deletions lib/shoulda/matchers/action_controller/redirect_to_matcher.rb

This file was deleted.

0 comments on commit 46076d5

Please sign in to comment.