Sha256: 0ec606a05d2ea8dfd85421f6218ba6358db616f871707ebd92b6552e1cbbafac

Contents?: true

Size: 473 Bytes

Versions: 9

Compression:

Stored size: 473 Bytes

Contents

require 'test_helper'

class Echo < Goliath::API
  use Goliath::Rack::Params

  def response(env)
    [200, {}, env.params['echo']]
  end
end

class EchoTest < Test::Unit::TestCase
  include Goliath::TestHelper

  def setup
    @err = Proc.new { assert false, "API request failed" }
  end

  def test_query_is_echoed_back
    with_api(Echo) do
      get_request({:query => {:echo => 'test'}}, @err) do |c|
        assert_equal 'test', c.response
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
goliath-1.0.7 test/echo_test.rb
goliath-1.0.6 test/echo_test.rb
goliath-1.0.5 test/echo_test.rb
goliath-1.0.4 test/echo_test.rb
goliath-1.0.3 test/echo_test.rb
goliath-1.0.2 test/echo_test.rb
goliath-1.0.1 test/echo_test.rb
goliath-1.0.0 test/echo_test.rb
goliath-1.0.0.beta.1 test/echo_test.rb