Commit 64f6a39390d8c2da63431ecf0708abffb4fb68d1

Authored by Carlos Morais
1 parent 1d2b4e54

Fix metric entities and fixtures

plugins/mezuro/lib/kalibro/entities/metric.rb
1 class Kalibro::Entities::Metric < Kalibro::Entities::Entity 1 class Kalibro::Entities::Metric < Kalibro::Entities::Entity
2 2
3 - attr_accessor :name, :scope, :description, :id  
4 -  
5 - def initialize name, scope, description, id  
6 - @name = name  
7 - @scope = scope  
8 - @description = description  
9 - @id = id  
10 - end 3 + attr_accessor :name, :scope, :description
11 4
12 end 5 end
plugins/mezuro/lib/kalibro/entities/native_metric.rb
@@ -2,4 +2,12 @@ class Kalibro::Entities::NativeMetric &lt; Kalibro::Entities::Metric @@ -2,4 +2,12 @@ class Kalibro::Entities::NativeMetric &lt; 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
6 \ No newline at end of file 14 \ No newline at end of file
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
plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 #FIXME dando erro 26 #FIXME dando erro
27 @collector.supported_metrics.each do |metric| %> 27 @collector.supported_metrics.each do |metric| %>
28 <div class="metric"> 28 <div class="metric">
29 - <%= label_tag "#{metric.origin}" %> 29 + <%= label_tag "#{metric.name}" %>
30 </div> 30 </div>
31 <% end 31 <% end
32 end %> 32 end %>