diff options
author | francis <francis> | 2008-01-23 01:54:49 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-23 01:54:49 +0000 |
commit | fdaa98e06ba6d6f8b62480a83e9ecffdbcb21402 (patch) | |
tree | 40b8b0d7602a7a17bead44e0fd3a2ea101b18bd6 /vendor/plugins/rspec/spec/spec_helper.rb | |
parent | 60eaae4f7df1f1dae91defb87d3707451c359cf4 (diff) |
Upgrade to rspec 1.1.2
Diffstat (limited to 'vendor/plugins/rspec/spec/spec_helper.rb')
-rw-r--r-- | vendor/plugins/rspec/spec/spec_helper.rb | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/vendor/plugins/rspec/spec/spec_helper.rb b/vendor/plugins/rspec/spec/spec_helper.rb index a7a4a82db..1318176d5 100644 --- a/vendor/plugins/rspec/spec/spec_helper.rb +++ b/vendor/plugins/rspec/spec/spec_helper.rb @@ -1,5 +1,4 @@ require 'stringio' -require 'rbconfig' dir = File.dirname(__FILE__) lib_path = File.expand_path("#{dir}/../lib") @@ -8,9 +7,10 @@ $_spec_spec = true # Prevents Kernel.exit in various places require 'spec' require 'spec/mocks' -require 'hpricot' # Needed to compare generated with wanted HTML +require 'spec/story' spec_classes_path = File.expand_path("#{dir}/../spec/spec/spec_classes") require spec_classes_path unless $LOAD_PATH.include?(spec_classes_path) +require File.dirname(__FILE__) + '/../lib/spec/expectations/differs/default' module Spec module Matchers @@ -40,7 +40,64 @@ module Spec def pass Pass.new end + + class CorrectlyOrderedMockExpectation + def initialize(&event) + @event = event + end + + def expect(&expectations) + expectations.call + @event.call + end + end + + def during(&block) + CorrectlyOrderedMockExpectation.new(&block) + end end end class NonStandardError < Exception; end + +module Custom + class ExampleGroupRunner + attr_reader :options, :arg + def initialize(options, arg) + @options, @arg = options, arg + end + + def load_files(files) + end + + def run + end + end +end + +def exception_from(&block) + exception = nil + begin + yield + rescue StandardError => e + exception = e + end + exception +end + +describe "sandboxed rspec_options", :shared => true do + attr_reader :options + + before(:all) do + @original_rspec_options = $rspec_options + end + + before(:each) do + @options = ::Spec::Runner::Options.new(StringIO.new, StringIO.new) + $rspec_options = options + end + + after do + $rspec_options = @original_rspec_options + end +end
\ No newline at end of file |