Thorã§ã¿ã¹ã¯ãæ¸ãã¨ãã®ã¡ã½ãããæ®éã®Rubyã®ããã«ã¯å¼ã¹ã¾ããã ããã§ããã£ã±ããã¹ãã¯æ¸ãããã®ã§Thorã®specãããããè¦ã¦ããããã¾ããã # encoding: utf-8 require "rubygems" require "thor" require "rspec" require "stringio" class Sample < Thor desc "name", "sample name" def name puts "pochi" end end describe Sample do it "should display 'pochi'" do capture(:stdout) { Sample.new.invoke("name") }.strip.should == "pochi" end end
{{#tags}}- {{label}}
{{/tags}}