Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed hello world examples

  • Loading branch information...
commit b1a1fdcb9df70c619aacf61c1e70de2621ac0ee8 1 parent c997f1c
@mikesea mikesea authored
Showing with 0 additions and 48 deletions.
  1. +0 −29 api/hello_world.rb
  2. +0 −19 test/integration/hello_world_test.rb
View
29 api/hello_world.rb
@@ -1,29 +0,0 @@
-describe_service "hello_world" do |service|
- service.formats :json
- service.http_verb :get
- service.disable_auth # on by default
-
- # INPUT
- service.param.string :name, :default => 'World'
-
- # OUTPUT
- service.response do |response|
- response.object do |obj|
- obj.string :message, :doc => "The greeting message sent back. Defaults to 'World'"
- obj.datetime :at, :doc => "The timestamp of when the message was dispatched"
- end
- end
-
- # DOCUMENTATION
- service.documentation do |doc|
- doc.overall "This service provides a simple hello world implementation example."
- doc.param :name, "The name of the person to greet."
- doc.example "<code>curl -I 'http://localhost:9292/hello_world?name=Matt'</code>"
- end
-
- # ACTION/IMPLEMENTATION
- service.implementation do
- {:message => "Hello #{params[:name]}", :at => Time.now}.to_json
- end
-
-end
View
19 test/integration/hello_world_test.rb
@@ -1,19 +0,0 @@
-require 'test_helpers'
-
-class HelloWorldIntegrationTest < MiniTest::Unit::TestCase
-
- def test_default_response
- TestApi.get "/hello_world"
- assert_api_response
- assert_equal "Hello World", TestApi.json_response['message']
- assert Time.parse(TestApi.json_response['at']) < Time.now
- end
-
- def test_customized_response
- TestApi.get "/hello_world", :name => "Matt"
- assert_api_response
- assert_equal "Hello Matt", TestApi.json_response['message']
- assert Time.parse(TestApi.json_response['at']) < Time.now
- end
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.