Skip to content

Instantly share code, notes, and snippets.

require 'roman_number'
describe Fixnum, "Roman Number" do
context "when try to convert a number" do
io_expections = {
0 => '',
1 => 'I',
2 => 'II',
class Fixnum
def to_roman
return '' unless self < 5000
roman_thousands(self) << roman_hundreds(self) << roman_tens(self) << roman_units(self)
end
private
def roman_units(unit)
require File.join(File.dirname(__FILE__), 'refactoring_example.rb')
describe Price do
let(:prices) do
{
:regular => RegularPrice.new,
:new_release => NewReleasePrice.new,
:children => ChildrenPrice.new,
}
end
class Price
attr_reader :price_code
def get_price_code
@price_code
end
def get_charge(days_rented)
# To implement in the subclass
raise NotImplemeted