Commit f0de97a9f4254382cb7154792ab27b04ab25a606
Committed by
Paulo Meireles
1 parent
b73ab208
Exists in
master
and in
28 other branches
[Mezuro] ModuleFixtures
Showing
2 changed files
with
18 additions
and
13 deletions
Show diff stats
| @@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
| 1 | +class ModuleFixtures | ||
| 2 | + | ||
| 3 | + def self.qt_calculator | ||
| 4 | + entity = Kalibro::Entities::Module.new | ||
| 5 | + entity.name = 'Qt-Calculator' | ||
| 6 | + entity.granularity = 'APPLICATION' | ||
| 7 | + entity | ||
| 8 | + end | ||
| 9 | + | ||
| 10 | + def self.qt_calculator_hash | ||
| 11 | + {:name => 'Qt-Calculator', :granularity => 'APPLICATION'} | ||
| 12 | + end | ||
| 13 | + | ||
| 14 | +end |
plugins/mezuro/test/unit/kalibro/entities/module_test.rb
| 1 | require "test_helper" | 1 | require "test_helper" |
| 2 | -class ModuleTest < ActiveSupport::TestCase | ||
| 3 | 2 | ||
| 4 | - def self.qt_calculator | ||
| 5 | - entity = Kalibro::Entities::Module.new | ||
| 6 | - entity.name = ProjectTest.qt_calculator.name | ||
| 7 | - entity.granularity = 'APPLICATION' | ||
| 8 | - entity | ||
| 9 | - end | 3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/module_fixtures" |
| 10 | 4 | ||
| 11 | - def self.qt_calculator_hash | ||
| 12 | - name = ProjectTest.qt_calculator.name | ||
| 13 | - {:name => name, :granularity => 'APPLICATION'} | ||
| 14 | - end | 5 | +class ModuleTest < ActiveSupport::TestCase |
| 15 | 6 | ||
| 16 | def setup | 7 | def setup |
| 17 | - @hash = self.class.qt_calculator_hash | ||
| 18 | - @module = self.class.qt_calculator | 8 | + @hash = ModuleFixtures.qt_calculator_hash |
| 9 | + @module = ModuleFixtures.qt_calculator | ||
| 19 | end | 10 | end |
| 20 | 11 | ||
| 21 | should 'create module from hash' do | 12 | should 'create module from hash' do |