Skip to content

Instantly share code, notes, and snippets.

@phuongnd08
Last active August 29, 2015 14:07
Show Gist options
  • Save phuongnd08/821d934f92f2e18aac16 to your computer and use it in GitHub Desktop.
Save phuongnd08/821d934f92f2e18aac16 to your computer and use it in GitHub Desktop.
example spec for testing lua code
require 'spec_helper'
describe "lua::calculate_pnl" do
context "prices is increasing" do
it "returns positive profit" do
pnl = Wolverine.util.calcualte_pnl([1, 2, 3])
pnl.should > 0
end
# more verifications
end
# more contexts
end
@phuongnd08
Copy link
Author

Then run the spec with bundle exec rspec spec/wolverine/pnl_spec.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment