Sha256: a3006ce5e57b1ab083c64a6de775f792dc42a0591bfb493e9f2466ae850d6d08

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe Jasmine::Result do
  describe "data accessors" do
    it "exposes failed expectations" do
      result = Jasmine::Result.new(failing_raw_result)
      expectation = result.failed_expectations[0]
      expectation.message.should == "a failure message"
      expectation.stack.should == "a stack trace"
    end

    it "exposes only the last 7 lines of the stack trace" do
      raw_result = failing_raw_result
      raw_result["failedExpectations"][0]["stack"] = "1\n2\n3\n4\n5\n6\n7\n8\n9"

      result = Jasmine::Result.new(raw_result)
      expectation = result.failed_expectations[0].stack
      expectation.should match(/1/)
      expectation.should match(/7/)
      expectation.should_not match(/8/)
      expectation.should_not match(/9/)
    end

    it "handles failed specs with no stack trace" do
      raw_result = failing_result_no_stack_trace

      result = Jasmine::Result.new(raw_result)
      expectation = result.failed_expectations[0].stack
      expectation.should match(/No stack/)
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jasmine-2.1.0 spec/result_spec.rb
jasmine-2.0.3 spec/result_spec.rb
jasmine-2.0.2 spec/result_spec.rb
jasmine-2.0.1 spec/result_spec.rb
jasmine-2.0.0 spec/result_spec.rb
jasmine-2.0.0.rc5 spec/result_spec.rb
jasmine-2.0.0.rc4 spec/result_spec.rb
jasmine-2.0.0.rc3 spec/result_spec.rb