spec/lib/uni_spec.rb in uni-0.0.8 vs spec/lib/uni_spec.rb in uni-0.0.9

- old
+ new

@@ -85,10 +85,14 @@ Uni::fast_uni(20090435).should eql '20090435F' end end end + describe '#get_facultad' do + specify { Uni.get_facultad('20072531g').should eql 'INGENIERÍA INDUSTRIAL Y DE SISTEMAS' } + specify { Uni.get_facultad('20104512B').should eql 'INGENIERÍA AMBIENTAL' } + end describe '#data' do let(:regular) { Uni::data '20072531G' } let(:titulado) { Uni::data '19100003B' } let(:egresado) { Uni::data '19780540K' } let(:invalido) { Uni::data '20072531a' } @@ -96,10 +100,13 @@ let(:inv_fixnum) { Uni.data 2007253 } it 'returns a Hash' do regular.should be_an_instance_of Hash end + it 'returns an empty Hash if codigo is nil' do + Uni.data(nil).should eql Hash.new + end it 'returns an empty Hash if codigo is invalid' do invalido.should eql Hash.new inv_fixnum.should eql Hash.new end it 'works with param as Fixnum' do @@ -126,21 +133,21 @@ [].should be_an_instance_of Array end xit 'returns an empty Array for invalid codigo and/or password' xit 'works with codigo as Fixnum or String' - context 'every element of Array' do + context 'items' do xit 'should be an instance of Hash' xit 'should have the keys :curso, :codigo, :seccion, :notas' - xit 'should have an instance of String as value for :curso, :codigo, :seccion' - xit 'should have an instance of Hash as value for :notas' - context ':notas' do - xit 'contains :practicas and :examenes' - context ':practicas and :examenes' do + xit 'should have a String as value for :curso, :codigo and :seccion' + xit 'should have a Hash as value for :notas' + context 'has key :notas' do + xit 'contains keys :practicas and :examenes' + context 'its keys :practicas and :examenes' do xit 'contains an instance of Array' - xit 'contains Strings as elements' + xit 'represents an evaluation has fields: type, grade, complaint and a fail rate' end end end - end -end +end +puts Uni.notas "20072531g", 91424 \ No newline at end of file