Created
June 30, 2015 11:16
-
-
Save JunichiIto/88cebd226976ab70878a to your computer and use it in GitHub Desktop.
Sample spec for https://twitter.com/tatzyr/status/615834332263899137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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