Sha256: a831c5d7dbd5f65d63dcbe3d883d82ba9ecd06f9d31fbd66bb7b58f9a4dbf504

Contents?: true

Size: 1017 Bytes

Versions: 3

Compression:

Stored size: 1017 Bytes

Contents

describe "AFMotion" do

  modules = [AFMotion::HTTP, AFMotion::JSON, AFMotion::XML, AFMotion::PLIST]

  modules.each do |_module|
    describe _module.to_s do
      it "should have all the HTTP methods" do
        AFMotion::HTTP_METHODS.each do |method|
          _module.respond_to?(method).should == true
        end
      end

      describe ".get" do
        before do
          @result = nil
        end

        it "should work with string" do
          _module.get("http://google.com") do |result|
            @result = result
            resume
          end
          wait_max(10) do
            @result.nil?.should == false
          end
        end

        it "should work with request" do
          request = NSURLRequest.requestWithURL(NSURL.URLWithString("http://google.com"))
          _module.get(request) do |result|
            @result = result
            resume
          end
          wait_max(10) do
            @result.nil?.should == false
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
afmotion-0.1 spec/http_spec.rb
afmotion-0.0.4 spec/http_spec.rb
afmotion-0.0.3 spec/http_spec.rb