Skip to content

Commit

Permalink
acabada
Browse files Browse the repository at this point in the history
  • Loading branch information
alu0101015729 committed Dec 21, 2018
1 parent 4b847e8 commit 81abdaa
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec/pract07_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,20 @@
@paciente9=Paciente.new("Maria Jesus",26,"hombre",56,132,0.54)
@paciente10=Paciente.new("Alexandra",35,"hombre",56,167,0.0)
@lista_pac=List.new()
@lista_pac.insertar_tail(@paciente1.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente2.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente3.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente4.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente5.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente6.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente7.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente8.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente9.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente10.gasto_energetico_total.round(2))
@lista_pac.insertar_tail(@paciente1)
@lista_pac.insertar_tail(@paciente2)
@lista_pac.insertar_tail(@paciente3)
@lista_pac.insertar_tail(@paciente4)
@lista_pac.insertar_tail(@paciente5)
@lista_pac.insertar_tail(@paciente6)
@lista_pac.insertar_tail(@paciente7)
@lista_pac.insertar_tail(@paciente8)
@lista_pac.insertar_tail(@paciente9)
@lista_pac.insertar_tail(@paciente10)

expect(@lista_pac.orden_for).to eq([1577.13,1681.68,1945.9,1951.13,2051.58,2066.4,2139.58,2183.5,2474.35,6701.75])
expect(@lista_pac.orden_each).to eq([1577.13,1681.68,1945.9,1951.13,2051.58,2066.4,2139.58,2183.5,2474.35,6701.75])
expect(@lista_pac.sort{|a,b| a<=>b}).to eq([1577.13,1681.68,1945.9,1951.13,2051.58,2066.4,2139.58,2183.5,2474.35,6701.75])
expect(@lista_pac.orden_for).to eq([@paciente10,@paciente2,@paciente1,@paciente3,@paciente6,@paciente9,@paciente8,@paciente7,@paciente5,@paciente4])
expect(@lista_pac.orden_each).to eq([@paciente10,@paciente2,@paciente1,@paciente3,@paciente6,@paciente9,@paciente8,@paciente7,@paciente5,@paciente4])
expect(@lista_pac.sort{|a,b| a<=>b}).to eq([@paciente10,@paciente2,@paciente1,@paciente3,@paciente6,@paciente9,@paciente8,@paciente7,@paciente5,@paciente4])
n = 50000
Benchmark.bm do |x|
x.report("for lista:") {n.times do @lista_pac.orden_for; end}
Expand Down

0 comments on commit 81abdaa

Please sign in to comment.