Skip to content

Instantly share code, notes, and snippets.

@ryanholm
Created June 13, 2014 05:29
Show Gist options
  • Save ryanholm/dffa6f21506038668a01 to your computer and use it in GitHub Desktop.
Save ryanholm/dffa6f21506038668a01 to your computer and use it in GitHub Desktop.
BLOC Reading RSpec Tests
#CP1
def link_to(text,address)
"<a href='#{address}'>#{text}</a>"
end
# RSpec
describe "link_to" do
it "should return a valid link for Bloc" do
link_to("Bloc", "http://www.bloc.io").should eq("<a href='http://www.bloc.io'>Bloc</a>")
end
it "should return a valid link for Google" do
link_to("Google", "http://www.google.com").should eq("<a href='http://www.google.com'>Google</a>")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment