Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Sulfura no cambia dias para vender #565

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions ruby/gilded_rose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,86 @@
GildedRose.new(items).update_quality()
expect(items[0].name).to eq "fixme"
end

context 'para items normales' do
before 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'

it 'incrementa su calidad en 2 cuando ya no quedan dias de venta'

it 'no incrementa su calidad por sobre 50'
end

context 'para items Sulfuras' do
before do
## Arrange
@items = [Item.new("Sulfuras, Hand of Ragnaros", 10, 2)]
@gilded = GildedRose.new(@items)
end

it 'no cambia su calidad'

it 'no cambia los dias para venderlo' do
@items[0].sell_in = 10

@gilded.update_quality()

expect(@items[0].sell_in).to eq 10
end
end

context 'para items Backstage Pass' do
it 'incrementa su calidad si quedan más de 10 días para venderlo'

it 'incrementa su calidad en 2 si quedan 10 dias o menos para venderlo'

it 'incrementa su calidad en 3 si quedan 5 dias o menos para venderlo'

it 'decrementa su calidad a 0 si ya no quedan dias para venderlo'
end

context 'para items conjurados' do
it 'decrementa su calidad en 2'
end
end