From f0de97a9f4254382cb7154792ab27b04ab25a606 Mon Sep 17 00:00:00 2001 From: Carlos Morais Date: Thu, 9 Feb 2012 20:27:17 -0200 Subject: [PATCH] [Mezuro] ModuleFixtures --- plugins/mezuro/test/fixtures/module_fixtures.rb | 14 ++++++++++++++ plugins/mezuro/test/unit/kalibro/entities/module_test.rb | 17 ++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 plugins/mezuro/test/fixtures/module_fixtures.rb diff --git a/plugins/mezuro/test/fixtures/module_fixtures.rb b/plugins/mezuro/test/fixtures/module_fixtures.rb new file mode 100644 index 0000000..d4e61ae --- /dev/null +++ b/plugins/mezuro/test/fixtures/module_fixtures.rb @@ -0,0 +1,14 @@ +class ModuleFixtures + + def self.qt_calculator + entity = Kalibro::Entities::Module.new + entity.name = 'Qt-Calculator' + entity.granularity = 'APPLICATION' + entity + end + + def self.qt_calculator_hash + {:name => 'Qt-Calculator', :granularity => 'APPLICATION'} + end + +end diff --git a/plugins/mezuro/test/unit/kalibro/entities/module_test.rb b/plugins/mezuro/test/unit/kalibro/entities/module_test.rb index 6a90226..0af90f8 100644 --- a/plugins/mezuro/test/unit/kalibro/entities/module_test.rb +++ b/plugins/mezuro/test/unit/kalibro/entities/module_test.rb @@ -1,21 +1,12 @@ require "test_helper" -class ModuleTest < ActiveSupport::TestCase - def self.qt_calculator - entity = Kalibro::Entities::Module.new - entity.name = ProjectTest.qt_calculator.name - entity.granularity = 'APPLICATION' - entity - end +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/module_fixtures" - def self.qt_calculator_hash - name = ProjectTest.qt_calculator.name - {:name => name, :granularity => 'APPLICATION'} - end +class ModuleTest < ActiveSupport::TestCase def setup - @hash = self.class.qt_calculator_hash - @module = self.class.qt_calculator + @hash = ModuleFixtures.qt_calculator_hash + @module = ModuleFixtures.qt_calculator end should 'create module from hash' do -- libgit2 0.21.2