Sha256: e3bba778895244c3a33531140d58df7e6a7511b49acd8cc78cd213c744b75ad9

Contents?: true

Size: 840 Bytes

Versions: 4

Compression:

Stored size: 840 Bytes

Contents

require 'spec_helper'

describe Sqed::Boundaries do

  let(:s) { Sqed::Boundaries.new}
  let(:layout) {:horizontal_split}

  specify "#coordinates defaults to a Hash when no layout provided" do
    expect(s.coordinates).to eq({})
  end

  context 'with a layout provided' do
    before {
      s.layout = layout
    }

    specify "coordinates can be initialized after the fact (bad idea likely)" do
      expect(s.initialize_coordinates).to be_truthy
    end

    specify "#coordinates has one coordinate system for each section (key in layout)" do
      s.initialize_coordinates
      expect(s.coordinates.keys.sort).to eq([0,1])
    end

    specify "#each" do
      s.initialize_coordinates
      s.each do |k,v|
        expect([0,1].include?(k)).to be(true) 
        expect(v).to eq([nil, nil, nil, nil])
      end
    end
  end

end 

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sqed-0.0.4 spec/lib/sqed/boundaries_spec.rb
sqed-0.0.3 spec/lib/sqed/boundaries_spec.rb
sqed-0.0.2 spec/lib/sqed/boundaries_spec.rb
sqed-0.0.1 spec/lib/sqed/boundaries_spec.rb