Commit 9cbf9d3730e0b35b9aa6b16aeb25bc726ca667ca
1 parent
b67cf9df
Exists in
master
and in
28 other branches
[Mezuro] Fixing Fixtures: attributes should all be strings as received from savon.
Showing
23 changed files
with
67 additions
and
60 deletions
Show diff stats
plugins/mezuro/lib/kalibro/metric_configuration_snapshot.rb
@@ -26,6 +26,7 @@ class Kalibro::MetricConfigurationSnapshot < Kalibro::Model | @@ -26,6 +26,7 @@ class Kalibro::MetricConfigurationSnapshot < Kalibro::Model | ||
26 | 26 | ||
27 | def to_hash | 27 | def to_hash |
28 | hash = super | 28 | hash = super |
29 | + puts hash | ||
29 | hash[:attributes!][:range] = {'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', | 30 | hash[:attributes!][:range] = {'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', |
30 | 'xsi:type' => 'kalibro:rangeSnapshotXml' } | 31 | 'xsi:type' => 'kalibro:rangeSnapshotXml' } |
31 | hash | 32 | hash |
plugins/mezuro/lib/kalibro/model.rb
@@ -15,7 +15,7 @@ class Kalibro::Model | @@ -15,7 +15,7 @@ class Kalibro::Model | ||
15 | if(!excepts.include?(field)) | 15 | if(!excepts.include?(field)) |
16 | field_value = send(field) | 16 | field_value = send(field) |
17 | if !field_value.nil? | 17 | if !field_value.nil? |
18 | - hash[field] = convert_to_hash(field_value) | 18 | + hash[field] = convert_to_hash(field_value) |
19 | if field_value.is_a?(Kalibro::Model) | 19 | if field_value.is_a?(Kalibro::Model) |
20 | hash = {:attributes! => {}}.merge(hash) | 20 | hash = {:attributes! => {}}.merge(hash) |
21 | hash[:attributes!][field.to_sym] = { | 21 | hash[:attributes!][field.to_sym] = { |
@@ -91,7 +91,7 @@ class Kalibro::Model | @@ -91,7 +91,7 @@ class Kalibro::Model | ||
91 | return self.class.date_with_milliseconds(value) if value.is_a?(DateTime) | 91 | return self.class.date_with_milliseconds(value) if value.is_a?(DateTime) |
92 | return 'INF' if value.is_a?(Float) and value.infinite? == 1 | 92 | return 'INF' if value.is_a?(Float) and value.infinite? == 1 |
93 | return '-INF' if value.is_a?(Float) and value.infinite? == -1 | 93 | return '-INF' if value.is_a?(Float) and value.infinite? == -1 |
94 | - value | 94 | + value.to_s |
95 | end | 95 | end |
96 | 96 | ||
97 | def xml_instance_class_name(object) | 97 | def xml_instance_class_name(object) |
plugins/mezuro/lib/kalibro/process_time.rb
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
@@ -47,6 +47,11 @@ class MezuroPlugin::Helpers::ContentViewerHelper | @@ -47,6 +47,11 @@ class MezuroPlugin::Helpers::ContentViewerHelper | ||
47 | def self.format_name(metric_configuration_snapshot) | 47 | def self.format_name(metric_configuration_snapshot) |
48 | metric_configuration_snapshot.metric.name.delete("() ") | 48 | metric_configuration_snapshot.metric.name.delete("() ") |
49 | end | 49 | end |
50 | + | ||
51 | + def self.format_time(time) | ||
52 | + time.class | ||
53 | + #MezuroPluginModuleResultController.helpers.distance_of_time_in_words(0, time/1000, include_seconds = true) | ||
54 | + end | ||
50 | 55 | ||
51 | private | 56 | private |
52 | 57 |
plugins/mezuro/test/fixtures/configuration_fixtures.rb
@@ -15,7 +15,7 @@ class ConfigurationFixtures | @@ -15,7 +15,7 @@ class ConfigurationFixtures | ||
15 | 15 | ||
16 | def self.configuration_hash | 16 | def self.configuration_hash |
17 | { | 17 | { |
18 | - :id => 42, | 18 | + :id => "42", |
19 | :name => 'Sample Configuration', | 19 | :name => 'Sample Configuration', |
20 | :description => 'Kalibro configuration for Java projects.' | 20 | :description => 'Kalibro configuration for Java projects.' |
21 | } | 21 | } |
plugins/mezuro/test/fixtures/metric_configuration_fixtures.rb
@@ -4,13 +4,13 @@ class MetricConfigurationFixtures | @@ -4,13 +4,13 @@ class MetricConfigurationFixtures | ||
4 | 4 | ||
5 | def self.amloc_metric_configuration | 5 | def self.amloc_metric_configuration |
6 | amloc = Kalibro::MetricConfiguration.new amloc_metric_configuration_hash | 6 | amloc = Kalibro::MetricConfiguration.new amloc_metric_configuration_hash |
7 | - amloc.configuration_id = 13 | 7 | + amloc.configuration_id = "13" |
8 | amloc | 8 | amloc |
9 | end | 9 | end |
10 | 10 | ||
11 | def self.sc_metric_configuration | 11 | def self.sc_metric_configuration |
12 | sc = Kalibro::MetricConfiguration.new sc_metric_configuration_hash | 12 | sc = Kalibro::MetricConfiguration.new sc_metric_configuration_hash |
13 | - sc.configuration_id = 13 | 13 | + sc.configuration_id = "13" |
14 | sc | 14 | sc |
15 | end | 15 | end |
16 | 16 | ||
@@ -19,22 +19,22 @@ class MetricConfigurationFixtures | @@ -19,22 +19,22 @@ class MetricConfigurationFixtures | ||
19 | :code => 'amloc', | 19 | :code => 'amloc', |
20 | :metric => MetricFixtures.amloc_hash, | 20 | :metric => MetricFixtures.amloc_hash, |
21 | :base_tool_name => MetricFixtures.amloc_hash[:origin], | 21 | :base_tool_name => MetricFixtures.amloc_hash[:origin], |
22 | - :weight => 1.0, | 22 | + :weight => "1.0", |
23 | :aggregation_form => 'AVERAGE', | 23 | :aggregation_form => 'AVERAGE', |
24 | - :reading_group_id => 31, | ||
25 | - :configuration_id => 13 | 24 | + :reading_group_id => "31", |
25 | + :configuration_id => "13" | ||
26 | }) | 26 | }) |
27 | end | 27 | end |
28 | 28 | ||
29 | def self.amloc_metric_configuration_hash | 29 | def self.amloc_metric_configuration_hash |
30 | { | 30 | { |
31 | - :id => 42, | 31 | + :id => "42", |
32 | :code => 'amloc', | 32 | :code => 'amloc', |
33 | :metric => MetricFixtures.amloc_hash, | 33 | :metric => MetricFixtures.amloc_hash, |
34 | :base_tool_name => MetricFixtures.amloc_hash[:origin], | 34 | :base_tool_name => MetricFixtures.amloc_hash[:origin], |
35 | - :weight => 1.0, | 35 | + :weight => "1.0", |
36 | :aggregation_form => 'AVERAGE', | 36 | :aggregation_form => 'AVERAGE', |
37 | - :reading_group_id => 31, | 37 | + :reading_group_id => "31", |
38 | :attributes! => {:metric => { | 38 | :attributes! => {:metric => { |
39 | 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', | 39 | 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', |
40 | 'xsi:type' => 'kalibro:metricXml' }} | 40 | 'xsi:type' => 'kalibro:metricXml' }} |
@@ -43,12 +43,12 @@ class MetricConfigurationFixtures | @@ -43,12 +43,12 @@ class MetricConfigurationFixtures | ||
43 | 43 | ||
44 | def self.sc_metric_configuration_hash | 44 | def self.sc_metric_configuration_hash |
45 | { | 45 | { |
46 | - :id => 42, | 46 | + :id => "42", |
47 | :code => 'sc', | 47 | :code => 'sc', |
48 | :metric => MetricFixtures.compound_metric_hash, | 48 | :metric => MetricFixtures.compound_metric_hash, |
49 | - :weight => 1.0, | 49 | + :weight => "1.0", |
50 | :aggregation_form => 'AVERAGE', | 50 | :aggregation_form => 'AVERAGE', |
51 | - :reading_group_id => 31, | 51 | + :reading_group_id => "31", |
52 | :attributes! => {:metric => { | 52 | :attributes! => {:metric => { |
53 | 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', | 53 | 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', |
54 | 'xsi:type' => 'kalibro:metricXml' }} | 54 | 'xsi:type' => 'kalibro:metricXml' }} |
plugins/mezuro/test/fixtures/metric_configuration_snapshot_fixtures.rb
@@ -10,7 +10,7 @@ class MetricConfigurationSnapshotFixtures | @@ -10,7 +10,7 @@ class MetricConfigurationSnapshotFixtures | ||
10 | def self.metric_configuration_snapshot_hash | 10 | def self.metric_configuration_snapshot_hash |
11 | { | 11 | { |
12 | :code => "code", | 12 | :code => "code", |
13 | - :weight => 1, | 13 | + :weight => "1", |
14 | :aggregation_form => 'AVERAGE', | 14 | :aggregation_form => 'AVERAGE', |
15 | :metric => MetricFixtures.amloc_hash, | 15 | :metric => MetricFixtures.amloc_hash, |
16 | :base_tool_name => "Analizo", | 16 | :base_tool_name => "Analizo", |
@@ -43,11 +43,11 @@ class MetricConfigurationSnapshotFixtures | @@ -43,11 +43,11 @@ class MetricConfigurationSnapshotFixtures | ||
43 | def self.compound_metric_configuration_snapshot_hash | 43 | def self.compound_metric_configuration_snapshot_hash |
44 | { | 44 | { |
45 | :code => "code", | 45 | :code => "code", |
46 | - :weight => 1, | 46 | + :weight => "1", |
47 | :aggregation_form => 'AVERAGE', | 47 | :aggregation_form => 'AVERAGE', |
48 | :metric => MetricFixtures.compound_metric, | 48 | :metric => MetricFixtures.compound_metric, |
49 | :base_tool_name => "Analizo", | 49 | :base_tool_name => "Analizo", |
50 | - :range => RangeSnapshotFixtures.range_snapshot_hash, | 50 | + :range => [RangeSnapshotFixtures.range_snapshot_hash], |
51 | :attributes! => { | 51 | :attributes! => { |
52 | :metric => { | 52 | :metric => { |
53 | 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', | 53 | 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance', |
plugins/mezuro/test/fixtures/metric_fixtures.rb
@@ -5,7 +5,7 @@ class MetricFixtures | @@ -5,7 +5,7 @@ class MetricFixtures | ||
5 | end | 5 | end |
6 | 6 | ||
7 | def self.compound_metric_hash | 7 | def self.compound_metric_hash |
8 | - {:name => 'Structural Complexity', :compound => true, :scope => 'CLASS', :script => 'return 42;', :description => 'Calculate the Structural Complexity of the Code'} | 8 | + {:name => 'Structural Complexity', :compound => "true", :scope => 'CLASS', :script => 'return 42;', :description => 'Calculate the Structural Complexity of the Code'} |
9 | end | 9 | end |
10 | 10 | ||
11 | def self.total_cof | 11 | def self.total_cof |
@@ -13,7 +13,7 @@ class MetricFixtures | @@ -13,7 +13,7 @@ class MetricFixtures | ||
13 | end | 13 | end |
14 | 14 | ||
15 | def self.total_cof_hash | 15 | def self.total_cof_hash |
16 | - {:name => 'Total Coupling Factor', :compound => false, :scope => 'APPLICATION', :origin => 'Analizo', :language => ['JAVA']} | 16 | + {:name => 'Total Coupling Factor', :compound => "false", :scope => 'APPLICATION', :origin => 'Analizo', :language => ['JAVA']} |
17 | end | 17 | end |
18 | 18 | ||
19 | def self.amloc | 19 | def self.amloc |
@@ -21,7 +21,7 @@ class MetricFixtures | @@ -21,7 +21,7 @@ class MetricFixtures | ||
21 | end | 21 | end |
22 | 22 | ||
23 | def self.amloc_hash | 23 | def self.amloc_hash |
24 | - {:name => 'Average Method LOC', :compound => false, :scope => 'CLASS', :origin => 'Analizo', :language => ['JAVA']} | 24 | + {:name => 'Average Method LOC', :compound => "false", :scope => 'CLASS', :origin => 'Analizo', :language => ['JAVA']} |
25 | end | 25 | end |
26 | 26 | ||
27 | end | 27 | end |
plugins/mezuro/test/fixtures/metric_result_fixtures.rb
@@ -13,7 +13,7 @@ class MetricResultFixtures | @@ -13,7 +13,7 @@ class MetricResultFixtures | ||
13 | 13 | ||
14 | def self.metric_result_with_error_hash | 14 | def self.metric_result_with_error_hash |
15 | { | 15 | { |
16 | - :id => 41, | 16 | + :id => "41", |
17 | :configuration => MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash, | 17 | :configuration => MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash, |
18 | :error => ThrowableFixtures.throwable_hash | 18 | :error => ThrowableFixtures.throwable_hash |
19 | } | 19 | } |
@@ -21,9 +21,9 @@ class MetricResultFixtures | @@ -21,9 +21,9 @@ class MetricResultFixtures | ||
21 | 21 | ||
22 | def self.native_metric_result_hash | 22 | def self.native_metric_result_hash |
23 | { | 23 | { |
24 | - :id => 42, | 24 | + :id => "42", |
25 | :configuration => MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash, | 25 | :configuration => MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash, |
26 | - :value => 0.0, | 26 | + :value => "0.0", |
27 | :attributes! => | 27 | :attributes! => |
28 | { | 28 | { |
29 | :configuration => | 29 | :configuration => |
@@ -37,9 +37,9 @@ class MetricResultFixtures | @@ -37,9 +37,9 @@ class MetricResultFixtures | ||
37 | 37 | ||
38 | def self.compound_metric_result_hash | 38 | def self.compound_metric_result_hash |
39 | { | 39 | { |
40 | - :id => 43, | 40 | + :id => "43", |
41 | :configuration => MetricConfigurationSnapshotFixtures.compound_metric_configuration_snapshot_hash, | 41 | :configuration => MetricConfigurationSnapshotFixtures.compound_metric_configuration_snapshot_hash, |
42 | - :value => 1.0, | 42 | + :value => "1.0", |
43 | :attributes! => | 43 | :attributes! => |
44 | { | 44 | { |
45 | :configuration => | 45 | :configuration => |
plugins/mezuro/test/fixtures/module_result_fixtures.rb
@@ -8,10 +8,10 @@ class ModuleResultFixtures | @@ -8,10 +8,10 @@ class ModuleResultFixtures | ||
8 | 8 | ||
9 | def self.module_result_hash | 9 | def self.module_result_hash |
10 | { | 10 | { |
11 | - :id => 42, | 11 | + :id => "42", |
12 | :module => ModuleFixtures.module_hash, | 12 | :module => ModuleFixtures.module_hash, |
13 | - :grade => 10.0, | ||
14 | - :parent_id => 31, | 13 | + :grade => "10.0", |
14 | + :parent_id => "31", | ||
15 | :attributes! => | 15 | :attributes! => |
16 | { | 16 | { |
17 | :module => | 17 | :module => |
@@ -25,12 +25,12 @@ class ModuleResultFixtures | @@ -25,12 +25,12 @@ class ModuleResultFixtures | ||
25 | 25 | ||
26 | def self.parent_module_result_hash | 26 | def self.parent_module_result_hash |
27 | { | 27 | { |
28 | - :id => 31, | 28 | + :id => "31", |
29 | :module => { | 29 | :module => { |
30 | :name => 'Qt-Calculator Parent', | 30 | :name => 'Qt-Calculator Parent', |
31 | :granularity => 'APPLICATION' | 31 | :granularity => 'APPLICATION' |
32 | }, | 32 | }, |
33 | - :grade => 10.0, | 33 | + :grade => "10.0", |
34 | :attributes! => | 34 | :attributes! => |
35 | { | 35 | { |
36 | :module => | 36 | :module => |
plugins/mezuro/test/fixtures/process_time_fixtures.rb
plugins/mezuro/test/fixtures/processing_fixtures.rb
@@ -9,17 +9,17 @@ class ProcessingFixtures | @@ -9,17 +9,17 @@ class ProcessingFixtures | ||
9 | 9 | ||
10 | def self.processing_hash | 10 | def self.processing_hash |
11 | { | 11 | { |
12 | - :id => 31, | 12 | + :id => "31", |
13 | :date => '2011-10-20T18:26:43.151+00:00', | 13 | :date => '2011-10-20T18:26:43.151+00:00', |
14 | :state => 'READY', | 14 | :state => 'READY', |
15 | :process_time => [ProcessTimeFixtures.process_time_hash], | 15 | :process_time => [ProcessTimeFixtures.process_time_hash], |
16 | - :results_root_id => 13 | 16 | + :results_root_id => "13" |
17 | } | 17 | } |
18 | end | 18 | end |
19 | 19 | ||
20 | def self.processing_with_error_hash | 20 | def self.processing_with_error_hash |
21 | { | 21 | { |
22 | - :id => 31, | 22 | + :id => "31", |
23 | :date => '2011-10-20T18:26:43.151+00:00', | 23 | :date => '2011-10-20T18:26:43.151+00:00', |
24 | :state => 'ERROR', | 24 | :state => 'ERROR', |
25 | :process_time => [ProcessTimeFixtures.process_time_hash], | 25 | :process_time => [ProcessTimeFixtures.process_time_hash], |
plugins/mezuro/test/fixtures/project_content_fixtures.rb
@@ -3,14 +3,7 @@ class ProjectContentFixtures | @@ -3,14 +3,7 @@ class ProjectContentFixtures | ||
3 | def self.project_content | 3 | def self.project_content |
4 | content = MezuroPlugin::ProjectContent.new | 4 | content = MezuroPlugin::ProjectContent.new |
5 | content.project_id = 42 | 5 | content.project_id = 42 |
6 | - #content.name = 'Qt-Calculator' | ||
7 | - #content.project_license = 'GPL' | ||
8 | - #content.description = 'Calculator for Qt' | ||
9 | - #content.repository_type = [RepositoryFixtures.repository_hash[:type]] | ||
10 | - #content.repository_url = [RepositoryFixtures.repository_hash[:address]] | ||
11 | - #content.configuration_name = 'Kalibro for Java' | ||
12 | - #content.periodicity_in_days = 1 | ||
13 | content | 6 | content |
14 | end | 7 | end |
15 | 8 | ||
16 | -end | ||
17 | \ No newline at end of file | 9 | \ No newline at end of file |
10 | +end |
plugins/mezuro/test/fixtures/project_fixtures.rb
@@ -12,7 +12,7 @@ class ProjectFixtures | @@ -12,7 +12,7 @@ class ProjectFixtures | ||
12 | 12 | ||
13 | def self.project_hash | 13 | def self.project_hash |
14 | { | 14 | { |
15 | - :id => 42, | 15 | + :id => "42", |
16 | :name => 'Qt-Calculator', | 16 | :name => 'Qt-Calculator', |
17 | :description => 'Calculator for Qt' | 17 | :description => 'Calculator for Qt' |
18 | } | 18 | } |
plugins/mezuro/test/fixtures/range_fixtures.rb
@@ -5,11 +5,11 @@ class RangeFixtures | @@ -5,11 +5,11 @@ class RangeFixtures | ||
5 | end | 5 | end |
6 | 6 | ||
7 | def self.created_range | 7 | def self.created_range |
8 | - Kalibro::Range.new :beginning => 19.5, :end => "INF", :reading_id => 1, :comments => "Test range 1" | 8 | + Kalibro::Range.new :beginning => "19.5", :end => "INF", :reading_id => "1", :comments => "Test range 1" |
9 | end | 9 | end |
10 | 10 | ||
11 | def self.range_hash | 11 | def self.range_hash |
12 | - {:id => 1, :beginning => 19.5, :end => "INF", :reading_id => 1, :comments => "Test range 1"} | 12 | + {:id => "1", :beginning => "19.5", :end => "INF", :reading_id => "1", :comments => "Test range 1"} |
13 | end | 13 | end |
14 | 14 | ||
15 | end | 15 | end |
plugins/mezuro/test/fixtures/range_snapshot_fixtures.rb
@@ -5,7 +5,7 @@ class RangeSnapshotFixtures | @@ -5,7 +5,7 @@ class RangeSnapshotFixtures | ||
5 | end | 5 | end |
6 | 6 | ||
7 | def self.range_snapshot_hash | 7 | def self.range_snapshot_hash |
8 | - { :end => 5, :label => "snapshot", :grade => 10, :color => "FF2284", :comments => "comment" } | 8 | + { :end => "5", :label => "snapshot", :grade => "10", :color => "FF2284", :comments => "comment" } |
9 | end | 9 | end |
10 | 10 | ||
11 | end | 11 | end |
plugins/mezuro/test/fixtures/reading_fixtures.rb
@@ -5,11 +5,11 @@ class ReadingFixtures | @@ -5,11 +5,11 @@ class ReadingFixtures | ||
5 | end | 5 | end |
6 | 6 | ||
7 | def self.created_reading # A created object has no id before being sent to kalibro | 7 | def self.created_reading # A created object has no id before being sent to kalibro |
8 | - Kalibro::Reading.new :label => "Reading Test Label", :grade => 10.5, :color => "AABBCC" | 8 | + Kalibro::Reading.new :label => "Reading Test Label", :grade => "10.5", :color => "AABBCC" |
9 | end | 9 | end |
10 | 10 | ||
11 | def self.reading_hash | 11 | def self.reading_hash |
12 | - {:id => 42, :label => "Reading Test Label", :grade => 10.5, :color => "AABBCC" } | 12 | + {:id => "42", :label => "Reading Test Label", :grade => "10.5", :color => "AABBCC" } |
13 | end | 13 | end |
14 | 14 | ||
15 | end | 15 | end |
plugins/mezuro/test/fixtures/reading_group_fixtures.rb
@@ -9,7 +9,7 @@ class ReadingGroupFixtures | @@ -9,7 +9,7 @@ class ReadingGroupFixtures | ||
9 | end | 9 | end |
10 | 10 | ||
11 | def self.reading_group_hash | 11 | def self.reading_group_hash |
12 | - {:id => 42, :name => "Reading Group Test", :description => "Reading group in the fixtures"} | 12 | + {:id => "42", :name => "Reading Group Test", :description => "Reading group in the fixtures"} |
13 | end | 13 | end |
14 | 14 | ||
15 | end | 15 | end |
plugins/mezuro/test/fixtures/repository_fixtures.rb
@@ -12,12 +12,12 @@ class RepositoryFixtures | @@ -12,12 +12,12 @@ class RepositoryFixtures | ||
12 | :process_period => "1", | 12 | :process_period => "1", |
13 | :type => 'SUBVERSION', | 13 | :type => 'SUBVERSION', |
14 | :address => 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator', | 14 | :address => 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator', |
15 | - :configuration_id => 31 | 15 | + :configuration_id => "31" |
16 | }) | 16 | }) |
17 | end | 17 | end |
18 | 18 | ||
19 | def self.repository_hash | 19 | def self.repository_hash |
20 | - {:id => 42, :name => "test repository", :description => "test description", :license => "GPL", :process_period => "1", :type => 'SUBVERSION', :address => 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator', :configuration_id => 31} | 20 | + {:id => "42", :name => "test repository", :description => "test description", :license => "GPL", :process_period => "1", :type => 'SUBVERSION', :address => "https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator", :configuration_id => "31"} |
21 | end | 21 | end |
22 | 22 | ||
23 | def self.types | 23 | def self.types |
plugins/mezuro/test/fixtures/stack_trace_element_fixtures.rb
1 | class StackTraceElementFixtures | 1 | class StackTraceElementFixtures |
2 | 2 | ||
3 | - def self.stack_trace_element(method_name = 'my method name', line_number = 42) | ||
4 | - Kalibro::StackTraceElement.new stack_trace_element_hash(method_name, line_number) | 3 | + def self.stack_trace_element |
4 | + Kalibro::StackTraceElement.new stack_trace_element_hash | ||
5 | end | 5 | end |
6 | 6 | ||
7 | - def self.stack_trace_element_hash(method_name = 'my method name', line_number = 42) | 7 | + def self.stack_trace_element_hash |
8 | { | 8 | { |
9 | :declaring_class => 'my.declaring.Class', | 9 | :declaring_class => 'my.declaring.Class', |
10 | - :method_name => method_name, | 10 | + :method_name => 'my method name', |
11 | :file_name => 'MyFile.java', | 11 | :file_name => 'MyFile.java', |
12 | - :line_number => line_number | 12 | + :line_number => '42' |
13 | } | 13 | } |
14 | end | 14 | end |
15 | 15 |
plugins/mezuro/test/fixtures/throwable_fixtures.rb
@@ -11,8 +11,7 @@ class ThrowableFixtures | @@ -11,8 +11,7 @@ class ThrowableFixtures | ||
11 | :target_string => 'Target String', | 11 | :target_string => 'Target String', |
12 | :message => 'Throwable message from ThrowableTest', | 12 | :message => 'Throwable message from ThrowableTest', |
13 | :stack_trace_element => [ | 13 | :stack_trace_element => [ |
14 | - StackTraceElementFixtures.stack_trace_element_hash('my method 1', 42), | ||
15 | - StackTraceElementFixtures.stack_trace_element_hash('my method 2', 84) | 14 | + StackTraceElementFixtures.stack_trace_element_hash, StackTraceElementFixtures.stack_trace_element_hash |
16 | ] | 15 | ] |
17 | } | 16 | } |
18 | end | 17 | end |
plugins/mezuro/test/unit/kalibro/process_time_test.rb
@@ -17,4 +17,8 @@ class ProcessTimeTest < ActiveSupport::TestCase | @@ -17,4 +17,8 @@ class ProcessTimeTest < ActiveSupport::TestCase | ||
17 | assert_equal @hash, @process_time.to_hash | 17 | assert_equal @hash, @process_time.to_hash |
18 | end | 18 | end |
19 | 19 | ||
20 | + should 'get time as an integer' do | ||
21 | + assert_equal 1.class, @process_time.time.class | ||
22 | + end | ||
23 | + | ||
20 | end | 24 | end |
plugins/mezuro/views/mezuro_plugin_processing/_processing.rhtml
@@ -8,9 +8,10 @@ | @@ -8,9 +8,10 @@ | ||
8 | <td><%= @processing.date %></td> | 8 | <td><%= @processing.date %></td> |
9 | </tr> | 9 | </tr> |
10 | <% @processing.process_time.each do |process_time| %> | 10 | <% @processing.process_time.each do |process_time| %> |
11 | + <%= process_time.inspect %> | ||
11 | <tr> | 12 | <tr> |
12 | <td><%= _(process_time.state + ' time') %></td> | 13 | <td><%= _(process_time.state + ' time') %></td> |
13 | - <td><%= process_time.time %></td> | 14 | + <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_time(process_time.time) %></td> |
14 | </tr> | 15 | </tr> |
15 | <% end %> | 16 | <% end %> |
16 | <tr> | 17 | <tr> |
@@ -33,4 +34,4 @@ | @@ -33,4 +34,4 @@ | ||
33 | }); | 34 | }); |
34 | </script> | 35 | </script> |
35 | 36 | ||
36 | -<span id="module_result_root_id" module_result_root_id="<%= @processing.results_root_id %>"> | ||
37 | \ No newline at end of file | 37 | \ No newline at end of file |
38 | +<span id="module_result_root_id" module_result_root_id="<%= @processing.results_root_id %>"> |