mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
16 lines
563 B
Ruby
16 lines
563 B
Ruby
require File.join(File.dirname(__FILE__), 'gilded_rose')
|
|
require 'test/unit'
|
|
|
|
class ItemFactoryTests < Test::Unit::TestCase
|
|
test ".create_item returns GenericItem instance if it is not a special item" do
|
|
created_item = ItemFactory.create_item(name: "random_item", sell_in: 0, quality: 0)
|
|
|
|
assert_instance_of GenericItem, created_item
|
|
end
|
|
|
|
test ".create_item returns Item instance if Aged Brie item if given" do
|
|
created_item = ItemFactory.create_item(name: "Aged Brie", sell_in: 0, quality: 0)
|
|
|
|
assert_instance_of Item, created_item
|
|
end
|
|
end |