metric_result_fixtures.rb
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require File.dirname(__FILE__) + '/compound_metric_fixtures'
require File.dirname(__FILE__) + '/native_metric_fixtures'
require File.dirname(__FILE__) + '/range_fixtures'
class MetricResultFixtures
def self.native_metric_result
Kalibro::MetricResult.new native_metric_result_hash
end
def self.compound_metric_result
Kalibro::MetricResult.new compound_metric_result_hash
end
def self.native_metric_result_hash
{
:metric => NativeMetricFixtures.amloc_hash,
:value => 0.0,
:descendent_result => [40.0, 42.0],
:range => RangeFixtures.range_excellent_hash,
:attributes! => {
:metric => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:nativeMetricXml' },
:range => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:rangeXml' }
}
}
end
def self.compound_metric_result_hash
{
:metric => CompoundMetricFixtures.compound_metric_hash,
:value => 1.0,
:descendent_result => [2.0, 42.0],
:attributes! => {
:metric => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:compoundMetricXml' }
}
}
end
end