Skip to content

Instantly share code, notes, and snippets.

@JunichiIto
Created June 30, 2015 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JunichiIto/88cebd226976ab70878a to your computer and use it in GitHub Desktop.
Save JunichiIto/88cebd226976ab70878a to your computer and use it in GitHub Desktop.
require 'spec_helper'
class Foo
def self.bar(*args)
puts "foo"
"bar"
end
end
describe Foo do
example do
ret = ""
expect{ret = Foo.bar}.to output("foo\n").to_stdout
expect(ret).to eq "bar"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment