ruby - how to call class method in rspec -
i have following class method
module abc class def class << self include ghi::lmn def mymethod(*args) puts 'class method' def value @value.nil? ? 'test' << name : @value end end end end
now how can write test cases method call method mymethod?
here's link on how call class method rspec
. create call class method in rspec
itself:
class foobar def initialize(foo, bar) @foo = foo @bar = bar end def output puts @foo puts @bar end end describe foo context bar subject { foobar.new(<info>).output } # create instance of class in rspec end end
Comments
Post a Comment