System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Commit 79298a5679a708bc2e950acd301b41898efedc78

added spec dirs +files

Commit diff

db/schema.rb

 
1# This file is autogenerated. Instead of editing this file, please use the
2# migrations feature of ActiveRecord to incrementally modify your database, and
3# then regenerate this schema definition.
4
5ActiveRecord::Schema.define() do
6
7end
toggle raw diff

previous_failures.txt

script/spec

 
1#!/usr/bin/env ruby
2$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../vendor/plugins/rspec/lib"))
3require 'spec'
4::Spec::Runner::CommandLine.run(ARGV, STDERR, STDOUT, true, true)
toggle raw diff

script/spec_server

 
1#!/usr/bin/env ruby
2$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../rspec/lib' # For svn
3$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
4require 'rubygems'
5require 'drb/drb'
6require 'rbconfig'
7require 'spec'
8require 'optparse'
9specmate = ENV['HOME'] + "/Library/Application\ Support/TextMate/Bundles/RSpec.tmbundle/Support/lib"
10if File.directory?(specmate)
11 $LOAD_PATH.unshift(specmate)
12 require 'text_mate_formatter'
13end
14
15# This is based on Florian Weber's TDDMate
16
17module Spec
18 module Runner
19 class RailsSpecServer
20 def run(args, stderr, stdout)
21 $stdout = stdout
22 $stderr = stderr
23
24 ::Dispatcher.reset_application!
25 ::Dependencies.mechanism = :load
26 require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)
27 load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
28
29 ::Spec::Runner::CommandLine.run(args, stderr, stdout, false, true)
30 end
31 end
32 end
33end
34puts "Loading Rails environment"
35
36ENV["RAILS_ENV"] = "test"
37require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
38require 'dispatcher'
39
40def restart_test_server
41 puts "restarting"
42 config = ::Config::CONFIG
43 ruby = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
44 command_line = [ruby, $0, ARGV].flatten.join(' ')
45 exec(command_line)
46end
47
48def daemonize(pid_file = nil)
49 return yield if $DEBUG
50 pid = Process.fork{
51 Process.setsid
52 Dir.chdir(RAILS_ROOT)
53 trap("SIGINT"){ exit! 0 }
54 trap("SIGTERM"){ exit! 0 }
55 trap("SIGHUP"){ restart_test_server }
56 File.open("/dev/null"){|f|
57 STDERR.reopen f
58 STDIN.reopen f
59 STDOUT.reopen f
60 }
61 yield
62 }
63 puts "spec_server launched. (PID: %d)" % pid
64 File.open(pid_file,"w"){|f| f.puts pid } if pid_file
65 exit! 0
66end
67
68options = Hash.new
69opts = OptionParser.new
70opts.on("-d", "--daemon"){|v| options[:daemon] = true }
71opts.on("-p", "--pid PIDFILE"){|v| options[:pid] = v }
72opts.parse!(ARGV)
73
74puts "Ready"
75exec_server = lambda {
76 trap("USR2") { restart_test_server } if Signal.list.has_key?("USR2")
77 DRb.start_service("druby://localhost:8989", Spec::Runner::RailsSpecServer.new)
78 DRb.thread.join
79}
80
81if options[:daemon]
82 daemonize(options[:pid], &exec_server)
83else
84 exec_server.call
85end
86
toggle raw diff

spec/spec.opts

 
1--colour
2--format
3progress
4--loadby
5mtime
6--reverse
toggle raw diff

spec/spec_helper.rb

 
1# This file is copied to ~/spec when you run 'ruby script/generate rspec'
2# from the project root directory.
3ENV["RAILS_ENV"] = "test"
4require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
5require 'spec/rails'
6
7Spec::Runner.configure do |config|
8 config.use_transactional_fixtures = true
9 config.use_instantiated_fixtures = false
10 config.fixture_path = RAILS_ROOT + '/spec/fixtures'
11
12 # You can declare fixtures for each behaviour like this:
13 # describe "...." do
14 # fixtures :table_a, :table_b
15 #
16 # Alternatively, if you prefer to declare them only once, you can
17 # do so here, like so ...
18 #
19 # config.global_fixtures = :table_a, :table_b
20 #
21 # If you declare global fixtures, be aware that they will be declared
22 # for all of your examples, even those that don't use them.
23end
toggle raw diff