- #Delete this example and add some real ones or delete this file
- it "should be included in the object returned by #helper" do
- included_modules = (class << helper; self; end).send :included_modules
- included_modules.should include(ReportsHelper)
+ describe "gradient_intercept" do
+ [
+ ["2 * x + 1" , ["2", "1"]],
+ ["-2 * x + 1" , ["-2", "1"]],
+ ["2 * x - 1" , ["2", "-1"]],
+ ["2*x+1" , ["2", "1"]],
+ ["-2*x+1" , ["-2", "1"]],
+ ["2*x-1" , ["2", "-1"]],
+ ["x" , ["1", "0"]],
+ ["x + 1" , ["1", "1"]],
+ ["x - 1" , ["1", "-1"]],
+ ["(1/2) * x + 1/2", ["1/2", "1/2"]],
+ ["(1 / 2) * x + 1 / 2", ["1/2", "1/2"]],
+ ["(-1 / 2) * x - 1 / 2", ["-1/2", "-1/2"]],
+ ].each do |expression, expected|
+ describe expression do
+ it{ gradient_intercept(expression).should == expected }
+ end
+ end