Skip to content

Commit

Permalink
Added rspecs to check for pi and sigma aliases from math extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
duper authored and duper committed Mar 7, 2011
1 parent 64f9cf3 commit 5b36450
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/extensions/math_spec.rb
Expand Up @@ -5,23 +5,31 @@

describe Math do
describe 'sigma' do
it 'should return 6 for S(1..3)' do
it 'should return 6 for sigma(1..3)' do
sigma(1..3) == 6
end

it 'should return 60 for sigma(3..5)' do
sigma(3..5) == 60
end

it 'should alias S to sigma' do
should respond_to(:S)
end
end

describe 'pi' do
it 'should return 24 for P(1..4)' do
it 'should return 24 for pi(1..4)' do
pi(1..4) == 24
end

it 'should return 30 for pi(5..6)' do
pi(5..6) == 30
end

it 'should alias P to pi' do
should respond_to(:P)
end
end

describe 'factorial' do
Expand Down

0 comments on commit 5b36450

Please sign in to comment.