Skip to content

Instantly share code, notes, and snippets.

@akiellor
Created October 26, 2012 19:47
Show Gist options
  • Save akiellor/3961028 to your computer and use it in GitHub Desktop.
Save akiellor/3961028 to your computer and use it in GitHub Desktop.
Talk
import math
class Calculator:
def plus(self, first, second):
return first + second
def pi(self):
return math.pi
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