pulsar/spec/atom/range-spec.coffee
Nathan Sobo 6bf82a27c9 Selections render themselves on screen (1 div per line)
Still a lot of details to cover, but basic selection creation is
working.
2012-01-26 18:54:18 -08:00

18 lines
606 B
CoffeeScript

Range = require 'range'
Point = require 'point'
describe "Range", ->
describe "constructor", ->
it "ensures that @start <= @end", ->
range1 = new Range(new Point(0, 1), new Point(0, 4))
expect(range1.start).toEqual(row: 0, column: 1)
range2 = new Range(new Point(1, 4), new Point(0, 1))
expect(range2.start).toEqual(row: 0, column: 1)
describe ".isEmpty()", ->
it "returns true if @start equals @end", ->
expect(new Range(new Point(1, 1), new Point(1, 1)).isEmpty()).toBeTruthy()
expect(new Range(new Point(1, 1), new Point(1, 2)).isEmpty()).toBeFalsy()