Skip to content

Instantly share code, notes, and snippets.

@esmevane
Created September 21, 2012 14:04
Show Gist options
  • Save esmevane/3761639 to your computer and use it in GitHub Desktop.
Save esmevane/3761639 to your computer and use it in GitHub Desktop.
Ruby: Indented, with explicit namespacing
require 'rspec' as "Spec"
require 'nokogiri' as "Nok"
require 'open_uri' as "Open"
class Index
attr_reader :response
def initialize url
@response = Nok::HTML Open url
Spec.describe Index do
it "should get web pages" do
@index = Index.new "http://www.google.com"
@index.response.should_not be_nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment