Skip to content

Commit

Permalink
test: implementar tests de items normales
Browse files Browse the repository at this point in the history
  • Loading branch information
felgaete committed Jul 29, 2024
1 parent 67d0ff7 commit f8c4d82
Showing 1 changed file with 41 additions and 7 deletions.
48 changes: 41 additions & 7 deletions ruby/gilded_rose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,47 @@
expect(items[0].name).to eq "fixme"
end

it 'decrementa la calidad del item'

it 'decrementa los dias para vender el item'

it 'decrementa la calidad del item al doble de velocidad cuando ya no quedan dias para venderlo'

it 'no decrementa la calidad del item a negativo'
context 'para items normales' do
setup do
## Arrange
items = [Item.new("foo", 10, 2)]
gilded = GildedRose.new(items)
end


it 'decrementa la calidad del item' do
#Act
gilded.update_quality()

#Assert
expect(items[0].quality).to eq 1
end

it 'decrementa los dias para vender el item' do
#Act
gilded.update_quality()

#Assert
expect(items[0].sell_in).to eq 9
end

it 'decrementa la calidad del item al doble de velocidad cuando ya no quedan dias para venderlo' do
items[0].sell_in = 0
items[0].quality = 20

gilded.update_quality()

expect(items[0].quality).to eq 18
end

it 'no decrementa la calidad del item a negativo' do
items[0].quality = 0

gilded.update_quality()

expect(items[0].quality).to eq 0
end
end

context 'para items Aged Brie' do
it 'incrementa su calidad'
Expand Down

0 comments on commit f8c4d82

Please sign in to comment.