Created
May 24, 2012 10:48
-
-
Save uiur/2780797 to your computer and use it in GitHub Desktop.
Quine in Ruby
This file contains hidden or 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
s=%q(;puts "s=%q(#{s})"+s);puts "s=%q(#{s})"+s |
This file contains hidden or 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 'rspec' | |
require_relative 'quine' | |
describe "quine" do | |
it "output equals its code" do |variable| | |
f = File.open("quine.rb") | |
f.read.should == `ruby quine.rb` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment