Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated to use plugit gem. Running against rails/rspec edge.

  • Loading branch information...
commit 3417791e6900e731fca04f1b451b7dd7e0b2706e 1 parent 63791a4
@aiwilliams aiwilliams authored
View
3  .gitignore
@@ -0,0 +1,3 @@
+vendor
+environments
+tmp
View
48 Rakefile
@@ -1,52 +1,10 @@
-require 'rubygems'
-gem 'rake'
-require 'rake'
-require 'rake/rdoctask'
-
-require "#{File.dirname(__FILE__)}/spec/environment"
-
-desc "Run all specs"
-task :spec => ["spec:libs:checkout"] do
- require "#{RSPEC_ROOT}/lib/spec/rake/spectask"
- Spec::Rake::SpecTask.new :spec do |t|
- t.spec_opts = ['--options', "\"#{SPEC_ROOT}/spec.opts\""]
- t.spec_files = FileList["#{SPEC_ROOT}/**/*_spec.rb"]
- end
-end
-
-namespace :spec do
- namespace :libs do
- desc "Prepare workspace for running our specs"
- task :checkout do
- mkdir_p SUPPORT_LIB
- libs = {
- RSPEC_ROOT => "http://rspec.rubyforge.org/svn/trunk/rspec",
- RSPEC_ON_RAILS_ROOT => "http://rspec.rubyforge.org/svn/trunk/rspec_on_rails",
- ACTIONPACK_ROOT => "http://svn.rubyonrails.org/rails/trunk/actionpack/",
- ACTIVESUPPORT_ROOT => "http://svn.rubyonrails.org/rails/trunk/activesupport/"
- }
- needed = libs.keys.select { |dir| not File.directory?(dir) }
- if needed.empty?
- puts "Support libraries are in place. Skipping checkout."
- else
- needed.each { |root| system "svn export #{libs[root]} #{root}" }
- end
- end
-
- desc "Remove libs from tmp directory"
- task :clean do
- rm_rf SUPPORT_LIB
- puts "cleaned #{SUPPORT_LIB}"
- end
- end
-end
+require File.expand_path(File.dirname(__FILE__) + '/testing/plugit_descriptor')
+require 'rake/rdoctask'
Rake::RDocTask.new(:doc) do |r|
r.title = "Rails Scenarios Plugin"
r.main = "README"
r.options << "--line-numbers"
r.rdoc_files.include("README", "LICENSE", "lib/**/*.rb")
r.rdoc_dir = "doc"
-end
-
-task :default => :spec
+end
View
2  spec/application.rb
@@ -1,2 +0,0 @@
-class ApplicationController < ActionController::Base
-end
View
1  spec/dsl/form_spec.rb
@@ -1,5 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'
-require 'integration_dsl_controller'
describe "submit_form", :type => :controller do
include Spec::Integration::DSL
View
11 spec/dsl/integration_spec_spec.rb
@@ -2,9 +2,14 @@
describe "An integration spec", :type => :integration do
it "should provide all the normal integration support" do
- get "/"
- response.should_not be_nil
- open_session.should_not == @integration_session
+ with_routing do |set|
+ set.draw do |map|
+ map.root :controller => 'integration_dsl'
+ get "/"
+ response.should_not be_nil
+ open_session.should_not == @integration_session
+ end
+ end
with_routing do |set|
set.draw do |map|
View
7 spec/dsl/navigation_spec.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../spec_helper'
-require 'integration_dsl_controller'
-describe Spec::Integration::DSL, "find_anchor", :type => :controller do
+describe "find_anchor", :type => :controller do
+ include Spec::Integration::DSL
controller_name :integration_dsl
before do
@@ -19,7 +19,8 @@
end
end
-describe Spec::Integration::DSL, "have_navigated_successfully", :type => :controller do
+describe "have_navigated_successfully", :type => :controller do
+ include Spec::Integration::DSL
controller_name :integration_dsl
it "should report the exception in the failure message" do
View
12 spec/environment.rb
@@ -1,12 +0,0 @@
-unless defined?(PLUGIN_ROOT)
- PLUGIN_ROOT = File.expand_path(File.dirname(__FILE__) + "/..")
- RAILS_ROOT = PLUGIN_ROOT
- SUPPORT_TEMP = "#{PLUGIN_ROOT}/tmp"
- SUPPORT_LIB = "#{SUPPORT_TEMP}/lib"
- ACTIONPACK_ROOT = "#{SUPPORT_LIB}/actionpack"
- ACTIVESUPPORT_ROOT = "#{SUPPORT_LIB}/activesupport"
- ACTIVERECORD_ROOT = "#{SUPPORT_LIB}/activerecord"
- RSPEC_ROOT = "#{SUPPORT_LIB}/rspec"
- RSPEC_ON_RAILS_ROOT = "#{SUPPORT_LIB}/rspec_on_rails"
- SPEC_ROOT = "#{PLUGIN_ROOT}/spec"
-end
View
5 spec/integration_dsl_controller.rb
@@ -1,5 +0,0 @@
-class IntegrationDslController < ActionController::Base
- def exploding
- raise "This will blow up!"
- end
-end
View
33 spec/spec_helper.rb
@@ -1,29 +1,8 @@
-require File.dirname(__FILE__) + "/../spec/environment"
+require File.expand_path(File.dirname(__FILE__) + "/../testing/plugit_descriptor")
-unless defined? DATABASE_ADAPTER
- $: << "#{SPEC_ROOT}"
- $: << "#{PLUGIN_ROOT}/lib"
- $: << "#{RSPEC_ROOT}/lib"
- $: << "#{ACTIONPACK_ROOT}/lib"
- $: << "#{ACTIVERECORD_ROOT}/lib"
- $: << "#{ACTIVESUPPORT_ROOT}/lib"
- $: << "#{RSPEC_ON_RAILS_ROOT}/lib"
+def fail_with(message)
+ raise_error(Spec::Expectations::ExpectationNotMetError, message)
+end
- require 'active_support'
- require 'active_record'
- require 'action_controller'
- require 'action_view'
-
- require 'spec'
- require 'spec/rails'
- require 'spec/integration'
-
- def fail_with(message)
- raise_error(Spec::Expectations::ExpectationNotMetError, message)
- end
-
- require 'logger'
- RAILS_DEFAULT_LOGGER = Logger.new("#{SUPPORT_TEMP}/test.log")
- RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
- ActiveRecord::Base.logger = RAILS_DEFAULT_LOGGER
-end
+require 'spec/integration'
+require 'integration_dsl_controller'
View
3  testing/application.rb
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ session :session_key => '_spec_integration', :secret => '1ad3fa0f557c45019a3736577fa3fe5e'
+end
View
0  spec/dispatcher.rb → testing/dispatcher.rb
File renamed without changes
View
5 testing/integration_dsl_controller.rb
@@ -0,0 +1,5 @@
+class IntegrationDslController < ApplicationController
+ def exploding
+ raise "This will blow up!"
+ end
+end
View
45 testing/plugit_descriptor.rb
@@ -0,0 +1,45 @@
+require 'rubygems'
+gem 'plugit'
+require 'plugit'
+
+$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/../lib")
+$LOAD_PATH << File.expand_path(File.dirname(__FILE__))
+RAILS_ROOT = File.expand_path("#{File.dirname(__FILE__)}/..")
+
+Plugit.describe do |scenarios|
+ scenarios.environments_root_path = File.dirname(__FILE__) + '/environments'
+ vendor_directory = File.expand_path(File.dirname(__FILE__) + '/../vendor/plugins')
+
+ scenarios.environment :default, 'Edge versions of Rails and RSpec' do |env|
+ env.library :rails, :export => "git clone git://github.com/rails/rails.git --depth 1" do |rails|
+ rails.before_install { `git pull` }
+ rails.load_paths = %w{/activesupport/lib /activerecord/lib /actionpack/lib}
+ rails.requires = %w{active_support active_record action_controller action_view}
+ end
+ env.library :rspec, :export => "git clone git://github.com/dchelimsky/rspec.git --depth 1" do |rspec|
+ rspec.before_install { `git pull && mkdir -p #{vendor_directory} && ln -sF #{File.expand_path('.')} #{vendor_directory + '/rspec'}` }
+ rspec.requires = %w{spec}
+ end
+ env.library :rspec_rails, :export => "git clone git://github.com/dchelimsky/rspec-rails.git --depth 1" do |rspec_rails|
+ rspec_rails.before_install { `git pull` }
+ rspec_rails.requires = %w{spec/rails}
+ end
+ end
+
+ scenarios.environment :released, 'Released versions of Rails and RSpec' do |env|
+ env.library :rails, :export => "git clone git://github.com/rails/rails.git" do |rails|
+ rails.after_update { `git co v2.1.0_RC1` }
+ rails.load_paths = %w{/activesupport/lib /activerecord/lib /actionpack/lib}
+ rails.requires = %w{active_support active_record action_controller action_view}
+ end
+ env.library :rspec, :export => "git clone git://github.com/dchelimsky/rspec.git" do |rspec|
+ rspec.after_update { `git co 1.1.4` }
+ rspec.before_install { `mkdir -p #{vendor_directory} && ln -sF #{File.expand_path('.')} #{vendor_directory + '/rspec'}` }
+ rspec.requires = %w{spec}
+ end
+ env.library :rspec_rails, :export => "git clone git://github.com/dchelimsky/rspec-rails.git" do |rspec_rails|
+ rspec_rails.after_update { `git co 1.1.4` }
+ rspec_rails.requires = %w{spec/rails}
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.