Permalink
Browse files

making service endpoint IP address based; also fixing bug in ARGV par…

…sing for service.rb
  • Loading branch information...
1 parent 00da625 commit 4c3d458565a9fadb968221eb6ccb17da4daba180 Tim Schmelmer committed Nov 22, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 chapter_01/service.rb
  2. +1 −1 chapter_01/spec/client_spec.rb
View
@@ -6,7 +6,7 @@
require "#{File.dirname(__FILE__)}/models/user"
# setting up our environment
-env_arg = ARGV.index("-e")
+env_arg = ARGV[ARGV.index("-e") + 1]
env = env_arg || ENV["SINATRA_ENV"] || "development"
databases = YAML.load_file("config/database.yml")
ActiveRecord::Base.establish_connection(databases[env])
@@ -7,7 +7,7 @@
# the database. We could change this by deleting all users in the test setup.
describe "client" do
before(:all) do
- User.base_uri = "http://localhost:3000"
+ User.base_uri = "http://127.0.0.1:3000"
User.destroy("paul")
User.destroy("trotter")

0 comments on commit 4c3d458

Please sign in to comment.