Sha256: cafb9d32c0d948f0ea4cc37058c40b5114b167f7bbdb3ddfd9cb7ee58b042433

Contents?: true

Size: 889 Bytes

Versions: 7

Compression:

Stored size: 889 Bytes

Contents

require 'test_helper'

class CraiglerTest < Test::Unit::TestCase
  context "Search interface" do
    should "respond to search" do
      assert_respond_to(Craigler, :search)
    end
    
    should "yield results to a block if given" do
      yielded = false 
      Craigler::search(:motorcycles, :in => :utah, :for => 'Yamaha', :page_limit => 1) do
        yielded = true; break;
      end
      
      assert(yielded, "results were never yielded to the block")
    end
  end
  
  context "Find interface" do
    should "respond to find" do
      assert_respond_to(Craigler, :find)
    end
    
    should "yield results to a block if given" do
      yielded = false 
      Craigler::find('Yamaha', :in => :utah, :only => :motorcycles, :page_limit => 1) do
        yielded = true; break;
      end
      
      assert(yielded, "results were never yielded to the block")
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
quixoten-craigler-1.1.0 test/craigler_test.rb
quixoten-craigler-1.2.0 test/craigler_test.rb
quixoten-craigler-1.2.1 test/craigler_test.rb
craigler-1.3.3 test/craigler_test.rb
craigler-1.3.2 test/craigler_test.rb
craigler-1.3.1 test/craigler_test.rb
craigler-1.3.0 test/craigler_test.rb