From cd973373d2e4bc31e2338af96bd7e8e2930ac5b9 Mon Sep 17 00:00:00 2001
From: Paolo Capriotti
Date: Fri, 17 Jul 2009 13:48:59 +0200
Subject: [PATCH] Fix tests.
---
lib/plugins/layouts/xboard.rb | 2 ++
lib/plugins/loader.rb | 2 +-
lib/plugins/themes/loader.rb | 1 +
test/test_controller.rb | 4 +---
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/plugins/layouts/xboard.rb b/lib/plugins/layouts/xboard.rb
index 0cd9228..9ab29bc 100644
--- a/lib/plugins/layouts/xboard.rb
+++ b/lib/plugins/layouts/xboard.rb
@@ -5,6 +5,8 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
+require 'plugins/plugin'
+
class XBoardLayout
include Plugin
diff --git a/lib/plugins/loader.rb b/lib/plugins/loader.rb
index 9e4e24b..0b8ff44 100644
--- a/lib/plugins/loader.rb
+++ b/lib/plugins/loader.rb
@@ -38,7 +38,7 @@ class PluginLoader
plugins = get_all_matching(interface).
sort_by {|x| x.score(keywords) }
- raise NoPluginFound("No plugins matching interface #{interface}") if plugins.empty?
+ raise NoPluginFound.new("No plugins matching interface #{interface}") if plugins.empty?
plugins.last
end
diff --git a/lib/plugins/themes/loader.rb b/lib/plugins/themes/loader.rb
index 9eb7697..50cdd0f 100644
--- a/lib/plugins/themes/loader.rb
+++ b/lib/plugins/themes/loader.rb
@@ -5,6 +5,7 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
+require 'plugins/plugin'
require_bundle 'themes', 'theme'
class ThemeLoader
diff --git a/test/test_controller.rb b/test/test_controller.rb
index ea1cf57..b6e0a38 100644
--- a/test/test_controller.rb
+++ b/test/test_controller.rb
@@ -13,12 +13,10 @@ require "games/all"
require 'dummy_player'
require 'board/scene'
require 'qtutils'
-require 'board/theme_loader'
require 'board/element_manager'
class TestController < Test::Unit::TestCase
class FakeTable
- include ThemeLoader
include ElementManager
attr_reader :scene, :elements, :game, :theme
@@ -29,7 +27,7 @@ class TestController < Test::Unit::TestCase
end
def reset(match)
- @theme = load_theme
+ @theme = @loader.get_matching(:theme_loader).new.load(@game)
@elements = create_elements
end
--
2.11.4.GIT