Commit 3fa0223a2babfbf00a52625da8ea88c7cf7c20c4
Committed by
Carlos Morais
1 parent
bc65fac5
Exists in
master
and in
28 other branches
[mezuro] Native metrics with multiple languages
Showing
2 changed files
with
12 additions
and
4 deletions
Show diff stats
plugins/mezuro/lib/kalibro/entities/native_metric.rb
| @@ -2,4 +2,12 @@ class Kalibro::Entities::NativeMetric < Kalibro::Entities::Metric | @@ -2,4 +2,12 @@ class Kalibro::Entities::NativeMetric < Kalibro::Entities::Metric | ||
| 2 | 2 | ||
| 3 | attr_accessor :origin, :language | 3 | attr_accessor :origin, :language |
| 4 | 4 | ||
| 5 | + def languages | ||
| 6 | + @language | ||
| 7 | + end | ||
| 8 | + | ||
| 9 | + def languages=(languages) | ||
| 10 | + @language = languages | ||
| 11 | + end | ||
| 12 | + | ||
| 5 | end | 13 | end |
plugins/mezuro/test/fixtures/native_metric_fixtures.rb
| @@ -5,12 +5,12 @@ class NativeMetricFixtures | @@ -5,12 +5,12 @@ class NativeMetricFixtures | ||
| 5 | total_cof.name = 'Total Coupling Factor' | 5 | total_cof.name = 'Total Coupling Factor' |
| 6 | total_cof.scope = 'APPLICATION' | 6 | total_cof.scope = 'APPLICATION' |
| 7 | total_cof.origin = 'Analizo' | 7 | total_cof.origin = 'Analizo' |
| 8 | - total_cof.language = 'JAVA' | 8 | + total_cof.languages = ['JAVA'] |
| 9 | total_cof | 9 | total_cof |
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | def self.total_cof_hash | 12 | def self.total_cof_hash |
| 13 | - {:name => 'Total Coupling Factor', :scope => 'APPLICATION', :origin => 'Analizo', :language => 'JAVA'} | 13 | + {:name => 'Total Coupling Factor', :scope => 'APPLICATION', :origin => 'Analizo', :language => ['JAVA']} |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | def self.amloc | 16 | def self.amloc |
| @@ -18,12 +18,12 @@ class NativeMetricFixtures | @@ -18,12 +18,12 @@ class NativeMetricFixtures | ||
| 18 | total_cof.name = 'Average Method LOC' | 18 | total_cof.name = 'Average Method LOC' |
| 19 | total_cof.scope = 'CLASS' | 19 | total_cof.scope = 'CLASS' |
| 20 | total_cof.origin = 'Analizo' | 20 | total_cof.origin = 'Analizo' |
| 21 | - total_cof.language = 'JAVA' | 21 | + total_cof.languages = ['JAVA'] |
| 22 | total_cof | 22 | total_cof |
| 23 | end | 23 | end |
| 24 | 24 | ||
| 25 | def self.amloc_hash | 25 | def self.amloc_hash |
| 26 | - {:name => 'Average Method LOC', :scope => 'CLASS', :origin => 'Analizo', :language => 'JAVA'} | 26 | + {:name => 'Average Method LOC', :scope => 'CLASS', :origin => 'Analizo', :language => ['JAVA']} |
| 27 | end | 27 | end |
| 28 | 28 | ||
| 29 | end | 29 | end |
| 30 | \ No newline at end of file | 30 | \ No newline at end of file |