Class: ExceptionState

Inherits:
Object show all
Defined in:
opal/lib/mspec/opal/mspec_fixes.rb

Overview

  1. Opal does not support mutable strings

Instance Method Summary collapse

Constructor Details

#initialize(state, location, exception) ⇒ ExceptionState

Returns a new instance of ExceptionState



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'opal/lib/mspec/opal/mspec_fixes.rb', line 6

def initialize(state, location, exception)
  @exception = exception

  @description = location ? ["An exception occurred during: #{location}"] : []
  if state
    @description << "\n" unless @description.empty?
    @description << state.description
    @describe = state.describe
    @it = state.it
    @description = @description.join ""
  else
    @describe = @it = ""
  end
end