Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Last active May 28, 2017 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukemorton/bd03c2e290c9014b5b3726932b53540c to your computer and use it in GitHub Desktop.
Save lukemorton/bd03c2e290c9014b5b3726932b53540c to your computer and use it in GitHub Desktop.
class MyHTTP
def get(uri)
@response = HTTP.get(uri)
end
def response
@response
end
end
describe MyHTTP do
let(:http) { MyHTTP.new }
context 'when retrieving response' do
subject { http.response }
context 'after getting uri' do
before { http.get('/') }
it { is_expected.not_to be_null }
end
context 'without getting' do
it { is_expected.to be_null }
end
end
end
class MySimpleHTTP
def get(uri)
HTTP.get(uri)
end
end
describe MySimpleHTTP do
let(:http) { MySimpleHTTP.new }
context 'when getting uri' do
subject { http.get('/') }
it { is_expected.not_to be_null }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment