Sha256: 4cb6c16d6c9cddef4247ff04955da108e1ae7b0b8537a029adcec489bbf10b42

Contents?: true

Size: 923 Bytes

Versions: 2

Compression:

Stored size: 923 Bytes

Contents

require 'test_helper'

class DreadTest < ActiveSupport::TestCase

  test 'initialization' do
    assert_nothing_raised do
      dread_graph = Dread::Graph.new('user')
    end
  end

  test 'initialization with missing constant' do
    assert_raises Dread::Error do
      dread_graph = Dread::Graph.new('uzer')
    end
  end

  test 'various clazz names' do
    %w(account_setting
       AccountSetting
       account_settings
       AccountSettings).each do |model_name|
      assert_equal AccountSetting, Dread::Graph.new(model_name).clazz
    end
  end

  test 'drawing' do
    dread_graph = Dread::Graph.new('user')
    dread_graph.draw
  end

  test 'collecting' do
    dread_graph = Dread::Graph.new('user')
    dependable_collection = dread_graph.dependable_collection
    dependable_collection.assert_valid_keys(:tweets, :comments, :setting)
    dependable_collection[:tweets].assert_valid_keys(:comments)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dread-0.0.4 test/dread_test.rb
dread-0.0.3 test/dread_test.rb