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

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -