Sha256: 07551c72ef67d5736cae43ff75b48ac63fcc2dfdcc451283a9900092f4310cea
Contents?: true
Size: 928 Bytes
Versions: 17
Compression:
Stored size: 928 Bytes
Contents
require 'tempfile' require 'sqlite3' require 'murlsh' describe Murlsh::Url do before do @db_file = Tempfile.open('murlsh_test_db') db = SQLite3::Database.new(@db_file.path) db.execute("CREATE TABLE urls ( id INTEGER PRIMARY KEY, time TIMESTAMP, url TEXT, email TEXT, name TEXT, title TEXT, content_type TEXT, via TEXT); ") ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => @db_file.path @url = Murlsh::Url.new end after do @db_file.close end it 'should return the url for the title if the title is nil' do @url.url = 'http://matthewm.boedicker.org/' @url.title = nil @url.title.should == @url.url end it 'should return the url for the title if the title is empty' do @url.url = 'http://matthewm.boedicker.org/' @url.title = '' @url.title.should == @url.url end end
Version data entries
17 entries across 17 versions & 1 rubygems