Sha256: 0b93afb90d5e6783962a669832e2f15ea38766f3f06c16c3604e0032d1a60cb1

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

require 'test/unit'
require 'voruby/active_votable/active_votable'

include VORuby::ActiveVotable

ActiveVotable.establish_connection(YAML::load(File.open('test/active_votable/database.yml'))['development'])

class ActiveVotableTest < Test::Unit::TestCase
  def setup
    @vot = ActiveVotable.build('test/active_votable/test.vot')
    @vot.items_per_page = 5
  end
  
  def test_page
    record = @vot.page(2).first
    
    assert_equal(record[:object], 'F4p11')
    assert_equal(record[:survey], 'NOAO Deep Lens')
    assert_equal(record[:instrument], 'NOAO.CTIO.4M')
    assert_equal(record[:ra], 163.669)
    assert_equal(record[:dec], -4.33333)
  end
  
  def teardown
    @vot.drop()
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voruby-1.0.2 test/active_votable/unittest.rb
voruby-1.1 test/active_votable/unittest.rb