Sha256: 1e4deddbbca11f46d75c6a18ac744062140537797b3e9035981746a324a85839

Contents?: true

Size: 1.05 KB

Versions: 165

Compression:

Stored size: 1.05 KB

Contents

def dbg; require "ruby-debug"; debugger; end;

require File.join(File.dirname(__FILE__), '../test_helper.rb')


class Bridges::BridgeTest < Test::Unit::TestCase
  def setup
    @const_store = {}
  end
  
  def teardown
  end
  
  def test__shouldnt_throw_errors
    ActiveScaffold::Bridge.run_all
  end
  
  def test__cds_bridge
    ConstMocker.mock("CalendarDateSelect") do |cm|
      cm.remove
      assert(! bridge_will_be_installed("CalendarDateSelect"))
      cm.declare
      assert(bridge_will_be_installed("CalendarDateSelect"))
    end
  end
  
  def test__file_column_bridge
    ConstMocker.mock("FileColumn") do |cm|
      cm.remove
      assert(! bridge_will_be_installed("FileColumn"))
      cm.declare
      assert(bridge_will_be_installed("FileColumn"))
    end
  end

protected

  def find_bridge(name)
    ActiveScaffold::Bridge.bridges.find{|b| b.name.to_s==name.to_s}
  end
  
  def bridge_will_be_installed(name)
    assert bridge=find_bridge(name), "No bridge found matching #{name}"
    
    bridge.instance_variable_get("@install_if").call
  end
end

Version data entries

165 entries across 165 versions & 7 rubygems

Version Path
active_scaffold_vho-4.0.0 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.14 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.13 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.12 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.11 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.10 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.9 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.8 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.7 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.6 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.5 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.4 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.3 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.2 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.1 test/bridges/bridge_test.rb
active_scaffold_vho-3.2.0 test/bridges/bridge_test.rb
active_scaffold_vho-3.0.31 test/bridges/bridge_test.rb
active_scaffold_vho-3.1.8 test/bridges/bridge_test.rb
active_scaffold_vho-3.0.30 test/bridges/bridge_test.rb
active_scaffold_vho-3.0.29 test/bridges/bridge_test.rb