Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class GildedRose
attr_accessor :items
def initialize(items)
@items = items
end
def update_quality
end
end
class Item
attr_accessor :name, :sell_in, :quality
def initialize(name, sell_in, quality)
@name, @sell_in, @quality = name, sell_in, quality
end
end
describe 'GildedRose' do
describe '.update_quality' do
it 'should decrement sell_in by 1'
it 'should decrement quality by 1'
context 'with a quality of 0 or 50' do
it 'should not change in quality'
end
context 'when sell_in is less than zero' do
it 'should set quality to 0'
end
context 'when item is Sulfuras, Hand of Ragnaros' do
it 'should never change quality'
it 'should never change sell_in'
end
context 'when item is Aged Brie' do
context 'with a sell_in greater than zero'
it 'should not change in quality'
it 'should decrement sell_in by 1'
end
context 'with a sell_in less than or equal to zero'
it 'should increase quality by 1'
it 'should decrement sell_in by 1'
end
end
context 'when item is Backstage Passes' do
context 'when sell_in is between 6-10 days' do
it 'should increment quality by 2'
end
context 'when sell_in is between 0-5 days' do
it 'should increment quality by 3'
end
end
context 'when item is Conjured' do
it 'should decrement quality by 2'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment