Created
October 26, 2012 19:47
-
-
Save akiellor/3961028 to your computer and use it in GitHub Desktop.
Talk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
class Calculator: | |
def plus(self, first, second): | |
return first + second | |
def pi(self): | |
return math.pi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
Calculator = Jython::Class.import "Calculator", | |
:from => "util.calculator" | |
describe Calculator do | |
let(:calculator) { Calculator.new } | |
it "should allow methods with no arguments to be called" do | |
calculator.pi.should be_within(0.00001).of(3.14159) | |
end | |
it "should allow methods with primitive arguments to be called" do | |
calculator.plus(1, 2).should == 3 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment