Sha256: 089851610da528e6f6917fbe401ea2561c5db8b68e0845f226319ec91f3cf2eb

Contents?: true

Size: 1.29 KB

Versions: 91

Compression:

Stored size: 1.29 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module Runner
    describe "NoisyBacktraceTweaker" do
      before(:each) do
        @error = RuntimeError.new
        @tweaker = NoisyBacktraceTweaker.new
      end
        
      it "should leave anything in lib spec dir" do
        ["expectations", "mocks", "runner", "stubs"].each do |child|
          @error.set_backtrace(["/lib/spec/#{child}/anything.rb"])
          @tweaker.tweak_backtrace(@error)
          @error.backtrace.should_not be_empty
        end
      end

      it "should leave anything in spec dir" do
        @error.set_backtrace(["/lib/spec/expectations/anything.rb"])
        @tweaker.tweak_backtrace(@error)
        @error.backtrace.should_not be_empty
      end

      it "should leave bin spec" do
        @error.set_backtrace(["bin/spec:"])
        @tweaker.tweak_backtrace(@error)
        @error.backtrace.should_not be_empty
      end

      it "should not barf on nil backtrace" do
        lambda do
          @tweaker.tweak_backtrace(@error)
        end.should_not raise_error
      end
      
      it "should clean up double slashes" do
        @error.set_backtrace(["/a//b/c//d.rb"])
        @tweaker.tweak_backtrace(@error)
        @error.backtrace.should include("/a/b/c/d.rb")
      end
      
    end
  end
end

Version data entries

91 entries across 91 versions & 12 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.1 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.13 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.2 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.3 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.4 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.5 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.6 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.7 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.8 spec/spec/runner/noisy_backtrace_tweaker_spec.rb
dchelimsky-rspec-1.1.99.9 spec/spec/runner/noisy_backtrace_tweaker_spec.rb