On Mon, Apr 13, 2009 at 12:09 PM, Salil Gaikwad <[email protected]> wrote:
> How to write a spec file for a following helper
>
> module ArtistsHelper
>
> def round_to(x)
>    (self * 10**x).round.to_f / 10**x
> end
>
> end

in spec/helpers/artists_helper_spec.rb:

describe AristsHelper do
  it "rounds to ...." do
    helper.round_to(xxx).should == yyy
  end
end

Cheers,
David

>
> Regards
>
> salil
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to