Commit f591f6d2dbc69f9fb56467a973f2acb486a6e78b
Committed by
Paulo Meireles
1 parent
38bd438e
Exists in
staging
and in
42 other branches
[Mezuro] ProjectResultFixtures
Showing
2 changed files
with
22 additions
and
19 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | +class ProjectResultFixtures | |
| 2 | + | |
| 3 | + def self.qt_calculator | |
| 4 | + result = Kalibro::Entities::ProjectResult.new | |
| 5 | + result.project = ProjectFixtures.qt_calculator | |
| 6 | + result.date = ModuleResultFixtures.create.date | |
| 7 | + result.load_time = 14878 | |
| 8 | + result.analysis_time = 1022 | |
| 9 | + result.source_tree = ModuleNodeFixtures.qt_calculator_tree | |
| 10 | + result | |
| 11 | + end | |
| 12 | + | |
| 13 | + def self.qt_calculator_hash | |
| 14 | + {:project => ProjectFixtures.qt_calculator_hash, :date => ModuleResultFixtures.create.date, | |
| 15 | + :load_time => 14878, :analysis_time => 1022, :source_tree => ModuleNodeFixtures.qt_calculator_tree_hash} | |
| 16 | + end | |
| 17 | + | |
| 18 | +end | ... | ... |
plugins/mezuro/test/unit/kalibro/entities/project_result_test.rb
| 1 | 1 | require "test_helper" |
| 2 | -class ProjectResultTest < ActiveSupport::TestCase | |
| 3 | 2 | |
| 4 | - def self.qt_calculator | |
| 5 | - result = Kalibro::Entities::ProjectResult.new | |
| 6 | - result.project = ProjectTest.qt_calculator | |
| 7 | - result.date = DateTime.parse('Thu, 20 Oct 2011 18:26:43.151 +0000') | |
| 8 | - result.load_time = 14878 | |
| 9 | - result.analysis_time = 1022 | |
| 10 | - result.source_tree = ModuleNodeTest.qt_calculator_tree | |
| 11 | - result | |
| 12 | - end | |
| 3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_result_fixtures" | |
| 13 | 4 | |
| 14 | - def self.qt_calculator_hash | |
| 15 | - {:project => ProjectTest.qt_calculator_hash, | |
| 16 | - :date => DateTime.parse('Thu, 20 Oct 2011 18:26:43.151 +0000'), | |
| 17 | - :load_time => 14878, | |
| 18 | - :analysis_time => 1022, | |
| 19 | - :source_tree => ModuleNodeTest.qt_calculator_tree_hash} | |
| 20 | - end | |
| 5 | +class ProjectResultTest < ActiveSupport::TestCase | |
| 21 | 6 | |
| 22 | 7 | def setup |
| 23 | - @hash = self.class.qt_calculator_hash | |
| 24 | - @result = self.class.qt_calculator | |
| 8 | + @hash = ProjectResultFixtures.qt_calculator_hash | |
| 9 | + @result = ProjectResultFixtures.qt_calculator | |
| 25 | 10 | end |
| 26 | 11 | |
| 27 | 12 | should 'create project result from hash' do | ... | ... |