mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Jasmine will call toString() if available to print an object.
This commit is contained in:
parent
c92397d55f
commit
82366b1226
@ -20,6 +20,13 @@ window.atom = new (require 'app')
|
||||
# Use underscore's definition of equality for toEqual assertions
|
||||
jasmine.Env.prototype.equals_ = _.isEqual
|
||||
|
||||
emitObject = jasmine.StringPrettyPrinter.prototype.emitObject
|
||||
jasmine.StringPrettyPrinter.prototype.emitObject = (obj) ->
|
||||
if obj.toString
|
||||
@append obj.toString()
|
||||
else
|
||||
emitObject.call(this, obj)
|
||||
|
||||
eventPropertiesFromPattern = (pattern) ->
|
||||
bindingSet = new BindingSet("*", {})
|
||||
parsedPattern = bindingSet.parseKeyPattern(pattern)
|
||||
|
@ -19,6 +19,9 @@ class Point
|
||||
else
|
||||
@row == other.row and @column == other.column
|
||||
|
||||
toString: ->
|
||||
"(#{@row}, #{@column})"
|
||||
|
||||
compare: (other) ->
|
||||
if @row > other.row
|
||||
1
|
||||
|
@ -13,6 +13,9 @@ class Range
|
||||
@start = pointB
|
||||
@end = pointA
|
||||
|
||||
toString: ->
|
||||
"[#{@start.toString()} - #{@end.toString()}]"
|
||||
|
||||
isEmpty: ->
|
||||
@start.isEqual(@end)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user