Commit ecffc84d42c4e8ee18316595dede319de6170795

Authored by Alessandro Palmeira + João M. M. da Silva
Committed by João M. M. da Silva
1 parent 6ffaed10

[Mezuro] Completed metric tests.

plugins/mezuro/test/unit/kalibro/compound_metric_test.rb
... ... @@ -1,20 +0,0 @@
1   -require "test_helper"
2   -
3   -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/compound_metric_fixtures"
4   -
5   -class CompoundMetricTest < ActiveSupport::TestCase
6   -
7   - def setup
8   - @hash = CompoundMetricFixtures.compound_metric_hash
9   - @metric = CompoundMetricFixtures.compound_metric
10   - end
11   -
12   - should 'create compound metric from hash' do
13   - assert_equal @hash[:script], Kalibro::CompoundMetric.new(@hash).script
14   - end
15   -
16   - should 'convert compound metric to hash' do
17   - assert_equal @hash, @metric.to_hash
18   - end
19   -
20   -end
plugins/mezuro/test/unit/kalibro/metric_test.rb 0 → 100644
... ... @@ -0,0 +1,29 @@
  1 +require "test_helper"
  2 +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures"
  3 +
  4 +class MetricTest < ActiveSupport::TestCase
  5 +
  6 + def setup
  7 + @native_hash = MetricFixtures.amloc_hash
  8 + @native = MetricFixtures.amloc
  9 + @compound_hash = MetricFixtures.compound_metric_hash
  10 + @compound = MetricFixtures.compound_metric
  11 + end
  12 +
  13 + should 'create native metric from hash' do
  14 + assert_equal @native_hash[:name], Kalibro::Metric.new(@native_hash).name
  15 + end
  16 +
  17 + should 'convert native metric to hash' do
  18 + assert_equal @native_hash, @native.to_hash
  19 + end
  20 +
  21 + should 'create compound metric from hash' do
  22 + assert_equal @compound_hash[:script], Kalibro::Metric.new(@compound_hash).script
  23 + end
  24 +
  25 + should 'convert compound metric to hash' do
  26 + assert_equal @compound_hash, @compound.to_hash
  27 + end
  28 +
  29 +end
... ...
plugins/mezuro/test/unit/kalibro/native_metric_test.rb
... ... @@ -1,20 +0,0 @@
1   -require "test_helper"
2   -
3   -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/native_metric_fixtures"
4   -
5   -class NativeMetricTest < ActiveSupport::TestCase
6   -
7   - def setup
8   - @hash = NativeMetricFixtures.amloc_hash
9   - @metric = NativeMetricFixtures.amloc
10   - end
11   -
12   - should 'create native metric from hash' do
13   - assert_equal @hash[:name], Kalibro::NativeMetric.new(@hash).name
14   - end
15   -
16   - should 'convert native metric to hash' do
17   - assert_equal @hash, @metric.to_hash
18   - end
19   -
20   -end