Sha256: 96f1b15a3c664f31d21112d9a135247500131cc7165a8e76f14c80540a8ab0c8

Contents?: true

Size: 744 Bytes

Versions: 9

Compression:

Stored size: 744 Bytes

Contents

require 'spec_helper'

describe CousinRoman do
  it 'should have a version number' do
    CousinRoman::VERSION.should_not be_nil
  end
end

describe String do
  [:to_arabian, :to_arabian!].each do |meth|
    it { should respond_to(meth) }

    it "should call CousinRoman::Roman.#{meth} on String##{meth}" do
      roman = 'i'
      CousinRoman::Roman.should_receive(meth).with(roman).and_call_original
      roman.send(meth).should == 1
    end
  end
end

describe Integer do
  [:to_roman, :to_roman!].each do |meth|
    it "should call CousinRoman::Arabian.#{meth} on Fixnum##{meth}" do
      arabian = 1
      CousinRoman::Arabian.should_receive(meth).with(arabian).and_call_original
      arabian.send(meth).should == 'I'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cousin_roman-1.0.8 spec/cousin_roman_spec.rb
cousin_roman-1.0.7 spec/cousin_roman_spec.rb
cousin_roman-1.0.6 spec/cousin_roman_spec.rb
cousin_roman-1.0.5 spec/cousin_roman_spec.rb
cousin_roman-1.0.4 spec/cousin_roman_spec.rb
cousin_roman-1.0.3 spec/cousin_roman_spec.rb
cousin_roman-1.0.2 spec/cousin_roman_spec.rb
cousin_roman-1.0.1 spec/cousin_roman_spec.rb
cousin_roman-1.0.0 spec/cousin_roman_spec.rb