Sha256: b85da3649833dbed17dd9f86bb445371a616cf878d8040b33764e68a284403f9
Contents?: true
Size: 1.11 KB
Versions: 6
Compression:
Stored size: 1.11 KB
Contents
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') subclasses = [ Smartfm::Item, Smartfm::List, Smartfm::Sentence, Smartfm::User ] subclasses.each do |klass| describe klass, '.attributes' do it "should return Array of attributes" do klass.attributes.should be_a(Array) end end if klass.respond_to?(:recent) describe klass, '.find' do it "should return nil if NOT FOUND" do klass.find(-1).should be_nil end end end if klass.respond_to?(:recent) describe klass, '.recent' do it "should return Array" do klass.recent.should be_a(Array) # blank response should be [] klass.recent(:per_page => 20, :page => 100000000000000).should be_empty klass.recent(:per_page => 20, :page => 100000000000000).should_not be_nil end end end if klass.respond_to?(:matching) describe klass, '.recent' do it "should return Array" do klass.matching("hello").should be_a(Array) klass.matching(rand_string).should be_empty klass.matching(rand_string).should_not be_nil end end end end
Version data entries
6 entries across 6 versions & 2 rubygems