Sha256: f628cb58308d01c885faa95ce930bdb1cbe6acdec324d123a38b03dfd1faec99

Contents?: true

Size: 1.63 KB

Versions: 35

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'

module RSpec::Core
  describe Runner do
    describe 'at_exit' do
      it 'sets an at_exit hook if none is already set' do
        RSpec::Core::Runner.stub(:installed_at_exit?).and_return(false)
        RSpec::Core::Runner.stub(:running_in_drb?).and_return(false)
        RSpec::Core::Runner.stub(:at_exit_hook_disabled?).and_return(false)
        RSpec::Core::Runner.should_receive(:at_exit)
        RSpec::Core::Runner.autorun
      end

      it 'does not set the at_exit hook if it is already set' do
        RSpec::Core::Runner.stub(:installed_at_exit?).and_return(true)
        RSpec::Core::Runner.stub(:running_in_drb?).and_return(false)
        RSpec::Core::Runner.stub(:at_exit_hook_disabled?).and_return(false)
        RSpec::Core::Runner.should_receive(:at_exit).never
        RSpec::Core::Runner.autorun
      end
    end

    describe "#run" do
      context "with --drb or -X" do
        before(:each) do
          @err = @out = StringIO.new

          @options = RSpec::Core::ConfigurationOptions.new(%w[--drb --drb-port 8181 --color])
          RSpec::Core::ConfigurationOptions.stub(:new) { @options }

          @drb_proxy = double(RSpec::Core::DRbCommandLine, :run => true)
          RSpec::Core::DRbCommandLine.stub(:new => @drb_proxy)
        end

        it "builds a DRbCommandLine" do
          RSpec::Core::DRbCommandLine.should_receive(:new)
          RSpec::Core::Runner.run(%w[ --drb ], @err, @out)
        end

        it "runs specs over the proxy" do
          @drb_proxy.should_receive(:run).with(@err, @out)
          RSpec::Core::Runner.run(%w[ --drb ], @err, @out)
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rspec-core-2.5.1/spec/rspec/core/runner_spec.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rspec-core-2.5.1/spec/rspec/core/runner_spec.rb
rspec-core-2.5.2 spec/rspec/core/runner_spec.rb
rspec-core-2.5.1 spec/rspec/core/runner_spec.rb
rspec-core-2.5.0 spec/rspec/core/runner_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
rspec-core-2.4.0 spec/rspec/core/runner_spec.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
rspec-core-2.3.1 spec/rspec/core/runner_spec.rb
rspec-core-2.3.0 spec/rspec/core/runner_spec.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
rspec-core-2.2.1 spec/rspec/core/runner_spec.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-core-2.1.0/spec/rspec/core/runner_spec.rb
rspec-core-2.2.0 spec/rspec/core/runner_spec.rb
rspec-core-2.1.0 spec/rspec/core/runner_spec.rb
rspec-core-2.0.1 spec/rspec/core/runner_spec.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/spec/rspec/core/runner_spec.rb