Commit 34870c26b255ce842c2d39c272a7d2ce0a14bcb3
Committed by
Paulo Meireles
1 parent
b4453065
Exists in
master
and in
29 other branches
[Mezuro] native_metric_fixtures
Showing
2 changed files
with
33 additions
and
29 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | +class NativeMetricFixtures | |
| 2 | + | |
| 3 | + def self.total_cof | |
| 4 | + total_cof = Kalibro::Entities::NativeMetric.new | |
| 5 | + total_cof.name = 'Total Coupling Factor' | |
| 6 | + total_cof.scope = 'APPLICATION' | |
| 7 | + total_cof.origin = 'Analizo' | |
| 8 | + total_cof.language = 'JAVA' | |
| 9 | + total_cof | |
| 10 | + end | |
| 11 | + | |
| 12 | + def self.total_cof_hash | |
| 13 | + {:name => 'Total Coupling Factor', :scope => 'APPLICATION', :origin => 'Analizo', :language => 'JAVA'} | |
| 14 | + end | |
| 15 | + | |
| 16 | + def self.amloc | |
| 17 | + total_cof = Kalibro::Entities::NativeMetric.new | |
| 18 | + total_cof.name = 'Average Method LOC' | |
| 19 | + total_cof.scope = 'CLASS' | |
| 20 | + total_cof.origin = 'Analizo' | |
| 21 | + total_cof.language = 'JAVA' | |
| 22 | + total_cof | |
| 23 | + end | |
| 24 | + | |
| 25 | + def self.amloc_hash | |
| 26 | + {:name => 'Average Method LOC', :scope => 'CLASS', :origin => 'Analizo', :language => 'JAVA'} | |
| 27 | + end | |
| 28 | + | |
| 29 | +end | |
| 0 | 30 | \ No newline at end of file | ... | ... |
plugins/mezuro/test/unit/kalibro/entities/native_metric_test.rb
| 1 | 1 | require "test_helper" |
| 2 | -class NativeMetricTest < ActiveSupport::TestCase | |
| 3 | - | |
| 4 | - def self.total_cof | |
| 5 | - total_cof = Kalibro::Entities::NativeMetric.new | |
| 6 | - total_cof.name = 'Total Coupling Factor' | |
| 7 | - total_cof.scope = 'APPLICATION' | |
| 8 | - total_cof.origin = 'Analizo' | |
| 9 | - total_cof.language = 'JAVA' | |
| 10 | - total_cof | |
| 11 | - end | |
| 12 | 2 | |
| 13 | - def self.amloc | |
| 14 | - total_cof = Kalibro::Entities::NativeMetric.new | |
| 15 | - total_cof.name = 'Average Method LOC' | |
| 16 | - total_cof.scope = 'CLASS' | |
| 17 | - total_cof.origin = 'Analizo' | |
| 18 | - total_cof.language = 'JAVA' | |
| 19 | - total_cof | |
| 20 | - end | |
| 3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/native_metric_fixtures" | |
| 21 | 4 | |
| 22 | - def self.total_cof_hash | |
| 23 | - {:name => 'Total Coupling Factor', :scope => 'APPLICATION', | |
| 24 | - :origin => 'Analizo', :language => 'JAVA'} | |
| 25 | - end | |
| 5 | +class NativeMetricTest < ActiveSupport::TestCase | |
| 26 | 6 | |
| 27 | - def self.amloc_hash | |
| 28 | - {:name => 'Average Method LOC', :scope => 'CLASS', | |
| 29 | - :origin => 'Analizo', :language => 'JAVA'} | |
| 30 | - end | |
| 31 | - | |
| 32 | 7 | def setup |
| 33 | - @hash = self.class.amloc_hash | |
| 34 | - @metric = self.class.amloc | |
| 8 | + @hash = NativeMetricFixtures.amloc_hash | |
| 9 | + @metric = NativeMetricFixtures.amloc | |
| 35 | 10 | end |
| 36 | 11 | |
| 37 | 12 | should 'create native metric from hash' do | ... | ... |