diff options
author | Louise Crow <louise.crow@gmail.com> | 2011-02-23 12:06:34 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2011-02-23 12:06:34 +0000 |
commit | 4cd0de91754f07afd0afb58d137b3adcf5a07611 (patch) | |
tree | 1a16f0c5af85f5e7561012b027545183584e15b8 /vendor/plugins/rspec/lib/spec/interop | |
parent | 44b78c1cd78607434b3666f5391ba68da647583f (diff) |
Removing rspec and rspec-rails plugins in favour of updated gems.
Diffstat (limited to 'vendor/plugins/rspec/lib/spec/interop')
6 files changed, 0 insertions, 207 deletions
diff --git a/vendor/plugins/rspec/lib/spec/interop/test.rb b/vendor/plugins/rspec/lib/spec/interop/test.rb deleted file mode 100644 index 284eb32ce..000000000 --- a/vendor/plugins/rspec/lib/spec/interop/test.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'spec' - -if Spec::Ruby.version.to_f >= 1.9 - gem 'test-unit','= 1.2.3' -end - -require 'test/unit' - -if Spec::Ruby.version.to_f >= 1.9 - require 'test/unit/version' - if Test::Unit::VERSION > '1.2.3' - raise <<-MESSAGE -#{'*' * 50} -Required: test-unit-1.2.3 -Loaded: test-unit-#{Test::Unit::VERSION} - -With ruby-1.9, rspec-#{Spec::VERSION::STRING} requires test-unit-1.2.3, and -tries to force it with "gem 'test-unit', '= 1.2.3'" in: - - #{__FILE__} - -Unfortunately, test-unit-#{Test::Unit::VERSION} was loaded anyway. While we are -aware of this bug we have not been able to track down its source. -Until we do, you have two alternatives: - -* uninstall test-unit-2.0.3 -* use 'script/spec' instead of 'rake spec' -#{'*' * 50} -MESSAGE - end -end - - -require 'test/unit/testresult' - -require 'spec/interop/test/unit/testcase' -require 'spec/interop/test/unit/testsuite_adapter' -require 'spec/interop/test/unit/autorunner' -require 'spec/interop/test/unit/testresult' -require 'spec/interop/test/unit/ui/console/testrunner' - -Spec::Example::ExampleGroupFactory.default(Test::Unit::TestCase) - -Test::Unit.run = true diff --git a/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb b/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb deleted file mode 100644 index 3944e6995..000000000 --- a/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Test::Unit::AutoRunner - remove_method :process_args - def process_args(argv) - true - end -end diff --git a/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb b/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb deleted file mode 100644 index dc10a2a64..000000000 --- a/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'test/unit/testcase' - -module Test - module Unit - # This extension of the standard Test::Unit::TestCase makes RSpec - # available from within, so that you can do things like: - # - # require 'spec/test/unit' - # - # class MyTest < Test::Unit::TestCase - # it "should work with Test::Unit assertions" do - # assert_equal 4, 2+1 - # end - # - # def test_should_work_with_rspec_expectations - # (3+1).should == 5 - # end - # end - # - # See also Spec::Example::ExampleGroup - class TestCase - extend Spec::Example::ExampleGroupMethods - include Spec::Example::ExampleMethods - - def self.suite - Test::Unit::TestSuiteAdapter.new(self) - end - - def self.example_method?(method_name) - should_method?(method_name) || test_method?(method_name) - end - - def self.test_method?(method_name) - method_name =~ /^test./ && ( - instance_method(method_name).arity == 0 || - instance_method(method_name).arity == -1 - ) - end - - before(:each) {setup} - after(:each) {teardown} - - def initialize(description, &implementation) - super - # Some Test::Unit extensions depend on @method_name being present. - @method_name = description.description - @_result = ::Test::Unit::TestResult.new - end - - def run(ignore_this_argument=nil) - super() - end - - end - end -end diff --git a/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb b/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb deleted file mode 100644 index dddcfe868..000000000 --- a/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Test::Unit::TestResult - alias_method :tu_passed?, :passed? - def passed? - return tu_passed? & ::Spec::Runner.run - end -end
\ No newline at end of file diff --git a/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb b/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb deleted file mode 100644 index 912762f18..000000000 --- a/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +++ /dev/null @@ -1,34 +0,0 @@ -module Test - module Unit - class TestSuiteAdapter < TestSuite - attr_reader :example_group, :examples - alias_method :tests, :examples - def initialize(example_group) - @example_group = example_group - @examples = example_group.examples - end - - def name - example_group.description - end - - def run(*args) - return true unless args.empty? - example_group.run(Spec::Runner.options) - end - - def size - example_group.number_of_examples - end - - def delete(example) - examples.delete example - end - - def empty? - examples.empty? - end - end - end -end - diff --git a/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb b/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb deleted file mode 100644 index 8e9995e02..000000000 --- a/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +++ /dev/null @@ -1,61 +0,0 @@ -require 'test/unit/ui/console/testrunner' - -module Test - module Unit - module UI - module Console - class TestRunner - - alias_method :started_without_rspec, :started - def started_with_rspec(result) - @result = result - @need_to_output_started = true - end - alias_method :started, :started_with_rspec - - alias_method :test_started_without_rspec, :test_started - def test_started_with_rspec(name) - if @need_to_output_started - if @rspec_io - @rspec_io.rewind - output(@rspec_io.read) - end - output("Started") - @need_to_output_started = false - end - test_started_without_rspec(name) - end - alias_method :test_started, :test_started_with_rspec - - alias_method :test_finished_without_rspec, :test_finished - def test_finished_with_rspec(name) - test_finished_without_rspec(name) - @ran_test = true - end - alias_method :test_finished, :test_finished_with_rspec - - alias_method :finished_without_rspec, :finished - def finished_with_rspec(elapsed_time) - @ran_test ||= false - if @ran_test - finished_without_rspec(elapsed_time) - end - end - alias_method :finished, :finished_with_rspec - - alias_method :setup_mediator_without_rspec, :setup_mediator - def setup_mediator_with_rspec - orig_io = @io - @io = StringIO.new - setup_mediator_without_rspec - ensure - @rspec_io = @io - @io = orig_io - end - alias_method :setup_mediator, :setup_mediator_with_rspec - - end - end - end - end -end |