Sha256: aaa3682d9bcd7701d726b4e08602bee2cd1b5e5643a3e9be79ac08518c03e020

Contents?: true

Size: 1.43 KB

Versions: 9

Compression:

Stored size: 1.43 KB

Contents

require "spec/spec_helper"

module RR
  module Adapters
    describe Rspec do
      describe "#trim_backtrace" do
        it "does not set trim_backtrace" do
          RR::Space.trim_backtrace.should == false
        end
      end

      describe ".included" do
        it "does not add backtrace identifier twice" do
          length = ::Spec::Runner::QuietBacktraceTweaker::IGNORE_PATTERNS.length
          class << Object.new
            include ::RR::Adapters::Rspec
          end
          ::Spec::Runner::QuietBacktraceTweaker::IGNORE_PATTERNS.length.should == length
        end
      end

      describe " backtrace tweaking" do
        attr_reader :original_rspec_options, :output
        before do
          @original_rspec_options = $rspec_options
          @output = StringIO.new("")
          $rspec_options = ::Spec::Runner::Options.new(output, StringIO.new)
        end

        after do
          $rspec_options = original_rspec_options
        end

        it "hides rr library from the backtrace by default" do
          subject = @subject
          Class.new(::Spec::Example::ExampleGroup) do
            describe "Example"

            it("hides RR framework in backtrace") do
              mock(subject).foobar()
              RR::Space::instance.verify_double(subject, :foobar)
            end
          end

          $rspec_options.run_examples

          output.string.should_not include("lib/rr")
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rr-0.4.0 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.3 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.6 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.2 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.1 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.8 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.4 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.7 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb
rr-0.4.5 spec/rr/rspec/rspec_backtrace_tweaking_spec.rb