Sha256: e1f4e4a1b22f5fda974c26d2c25916206cdb058bffb5bc0c001ee5edd021f1e9

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

#coding:utf-8
require File.dirname(__FILE__) + '/spec_helper.rb'

describe SFCRoom do
  describe 'parser' do
    it 'can parse all roman classroom' do
      include SFCRoom
      room = SFCRoom.parse('i11')
      room.building.should eql(SFCRoom::Buildings::Iota)
      room.room.should eql('11')
      room.floor.should eql('1')
    end
    it 'can parse greek classroom' do
      include SFCRoom
      room = SFCRoom.parse('ι411')
      room.building.should eql(SFCRoom::Buildings::Iota)
      room.room.should eql('411')
      room.floor.should eql('4')
      room.to_s.should eql('イオタ411')
    end

    it 'can parse japanese classroom' do
      room = SFCRoom.parse('ラムダ19')
      room.building.should eql(SFCRoom::Buildings::Lambda)
      room.room.should eql('19')
      room.floor.should eql('1')
      room.to_s.should eql('ラムダ19')
    end
    
    it 'can parse delta classroom' do
      room = SFCRoom.parse('ΔS113')
      room.building.should eql(SFCRoom::Buildings::Delta)
      room.room.should eql('S113')
      room.floor.should eql('s1')
      room.to_s.should eql('デルタS113')
    end

    it 'can parse tau loft' do
      room = SFCRoom.parse('タウ館2階ロフト')
      room.building.should eql(SFCRoom::Buildings::Tau)
      room.room.should eql('20')
      room.floor.should eql('2')
      room.to_s.should eql('タウ20')
    end


  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sfc-room-0.0.1 spec/parser_spec.rb