From f5bb5c6e8447a294533c63670c912b3c2ac6e430 Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Fri, 17 Oct 2008 19:04:40 -0200 Subject: [PATCH] remove unneeded use of SandboxedOptions --- spec/spec/mocks/nil_expectation_warning_spec.rb | 1 - spec/spec/runner/drb_command_line_spec.rb | 2 -- spec/spec/runner/formatter/html_formatter_spec.rb | 5 +---- spec/spec/runner/formatter/spec_mate_formatter_spec.rb | 5 ++--- spec/spec_helper.rb | 8 ++++---- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/spec/spec/mocks/nil_expectation_warning_spec.rb b/spec/spec/mocks/nil_expectation_warning_spec.rb index 392dfb64a..606a14fc9 100644 --- a/spec/spec/mocks/nil_expectation_warning_spec.rb +++ b/spec/spec/mocks/nil_expectation_warning_spec.rb @@ -31,7 +31,6 @@ module Mocks end describe "#allow_message_expectations_on_nil" do - include SandboxedOptions it "should not effect subsequent examples" do example_group = Class.new(ExampleGroup) diff --git a/spec/spec/runner/drb_command_line_spec.rb b/spec/spec/runner/drb_command_line_spec.rb index 7fb67b03a..b370be941 100644 --- a/spec/spec/runner/drb_command_line_spec.rb +++ b/spec/spec/runner/drb_command_line_spec.rb @@ -3,8 +3,6 @@ module Spec module Runner describe DrbCommandLine, "without running local server" do - include SandboxedOptions - unless Config::CONFIG['ruby_install_name'] == 'jruby' it "should print error when there is no running local server" do err = StringIO.new diff --git a/spec/spec/runner/formatter/html_formatter_spec.rb b/spec/spec/runner/formatter/html_formatter_spec.rb index 38c99d770..abf2283bc 100644 --- a/spec/spec/runner/formatter/html_formatter_spec.rb +++ b/spec/spec/runner/formatter/html_formatter_spec.rb @@ -6,7 +6,6 @@ module Spec module Runner module Formatter describe HtmlFormatter do - include SandboxedOptions ['--diff', '--dry-run'].each do |opt| def jruby? PLATFORM == 'java' @@ -23,9 +22,7 @@ def jruby? args = ['failing_examples/mocking_example.rb', 'failing_examples/diffing_spec.rb', 'examples/pure/stubbing_example.rb', 'examples/pure/pending_example.rb', '--format', 'html', opt] err = StringIO.new out = StringIO.new - run_with( - OptionParser.parse(args, err, out) - ) + run_with OptionParser.parse(args, err, out) seconds = /\d+\.\d+ seconds/ html = out.string.gsub seconds, 'x seconds' diff --git a/spec/spec/runner/formatter/spec_mate_formatter_spec.rb b/spec/spec/runner/formatter/spec_mate_formatter_spec.rb index e5f36888f..6a91aaba8 100644 --- a/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +++ b/spec/spec/runner/formatter/spec_mate_formatter_spec.rb @@ -6,7 +6,6 @@ module Spec module Runner module Formatter describe TextMateFormatter do - include SandboxedOptions attr_reader :root, :suffix, :expected_file before do @root = File.expand_path(File.dirname(__FILE__) + '/../../../..') @@ -33,9 +32,9 @@ def produces_html_identical_to_manually_designed_document(opt) ] err = StringIO.new out = StringIO.new - options = ::Spec::Runner::OptionParser.parse(args, err, out) - run_with(options) + run_with ::Spec::Runner::OptionParser.parse(args, err, out) + yield(out.string) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7f4f0fe10..bbccfbfef 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,6 +35,10 @@ def exception_from(&block) end exception end + + def run_with(options) + ::Spec::Runner::CommandLine.run(options) + end end end @@ -49,8 +53,4 @@ def exception_from(&block) after(:each) do ::Spec::Runner.use(@original_rspec_options) end - - def run_with(options) - ::Spec::Runner::CommandLine.run(options) - end end unless Object.const_defined?(:SandboxedOptions)