Created
September 21, 2012 14:04
-
-
Save esmevane/3761639 to your computer and use it in GitHub Desktop.
Ruby: Indented, with explicit namespacing
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 '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