Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 45 additions and 2 deletions.
  1. +5 −2 Gemfile
  2. +15 −0 Gemfile.lock
  3. +5 −0 Rakefile
  4. +20 −0 spec/blog_spec.rb
View
7 Gemfile
@@ -1,2 +1,5 @@
-source 'https://rubygems.org'
-gem 'rack'
+source "https://rubygems.org"
+gem "rack"
+gem "rack-test"
+gem "rspec"
+gem "rake"
View
15 Gemfile.lock
@@ -1,10 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
+ diff-lcs (1.1.3)
rack (1.4.1)
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rake (0.9.2.2)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
PLATFORMS
ruby
DEPENDENCIES
rack
+ rack-test
+ rake
+ rspec
View
5 Rakefile
@@ -0,0 +1,5 @@
+require "rspec/core/rake_task"
+
+RSpec::Core::RakeTask.new(:spec)
+
+task :default => :spec
View
20 spec/blog_spec.rb
@@ -0,0 +1,20 @@
+require "rack/test"
+require_relative "../blog"
+
+describe Blog do
+ include Rack::Test::Methods
+
+ def app
+ Blog.new
+ end
+
+ it "greets the user by name" do
+ get "/", name: "Bob"
+ last_response.body.should include("Bob")
+ end
+
+ it "greets the user as John Doe by default" do
+ get "/"
+ last_response.body.should include("John Doe")
+ end
+end

No commit comments for this range

Something went wrong with that request. Please try again.