Created
August 29, 2008 05:20
-
-
Save scudco/7901 to your computer and use it in GitHub Desktop.
Manual Spec'ing
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
# Soon to be gemified | |
# http://github.com/scudco/horrible | |
require 'rubygems' | |
require 'spec' | |
require 'highline/import' | |
module Moonit | |
module Spec | |
def step(description,&block) | |
answer = ask description | |
yield if block_given? | |
answer | |
end | |
end | |
end | |
module Spec::Example::ExampleGroupMethods | |
def you(description,&block) | |
if ENV['MANUAL'] | |
it("#{description}",&block) | |
else | |
it("#{description}") do | |
pending("This needs to be executed MANUALLY") | |
end | |
end | |
end | |
end | |
describe "Bar" do | |
include Moonit::Spec | |
it "should be a bar" do | |
"bar".should == "bar" | |
end | |
you "should verify that this dumb weird thing is up" do | |
step "\nBar needs to equal bar and after that foo needs to equal foo" | |
step("what does bar say?") { @foo = "bar" }.should == "bar" | |
step("what does foo say?").should == "foo" | |
end | |
it "should be awesome" do | |
true.should be_true | |
end | |
you "should verify this other thing" do | |
step "\nThis other thing is important, alright?" | |
step("what does the important thing say?").should == "thing" | |
step("<sarcasm>I wish I could integrate screenshots into this somehow so I could show you how to use an application because, let's be honest you are entirely too retarded to understand how to use an application without seeing lots of malformed and outdated screenshots.</sarcasm>").should == "orly" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment