Commit 166c9b0725586b4c3ecfe4a71b67b36849b34a32

Authored by Carlos Morais
Committed by Paulo Meireles
1 parent 34870c26

[Mezuro] BaseToolFixtures

plugins/mezuro/test/fixtures/base_tool_fixtures.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +class BaseToolFixtures
  2 +
  3 + def self.analizo
  4 + base_tool = Kalibro::Entities::BaseTool.new
  5 + base_tool.name = 'Analizo'
  6 + base_tool.supported_metrics = [
  7 + NativeMetricFixtures.total_cof,
  8 + NativeMetricFixtures.amloc]
  9 + base_tool
  10 + end
  11 +
  12 + def self.analizo_hash
  13 + {:name => 'Analizo', :supported_metric => [
  14 + NativeMetricFixtures.total_cof_hash,
  15 + NativeMetricFixtures.amloc_hash]}
  16 + end
  17 +
  18 +end
... ...
plugins/mezuro/test/unit/kalibro/entities/base_tool_test.rb
1 1 require "test_helper"
2   -class BaseToolTest < ActiveSupport::TestCase
3 2  
4   - def self.analizo
5   - total_cof = NativeMetricTest.total_cof
6   - amloc = NativeMetricTest.amloc
7   - base_tool = Kalibro::Entities::BaseTool.new
8   - base_tool.name = 'Analizo'
9   - base_tool.supported_metrics = [total_cof, amloc]
10   - base_tool
11   - end
  3 +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures"
12 4  
13   - def self.analizo_hash
14   - total_cof_hash = NativeMetricTest.total_cof_hash
15   - amloc_hash = NativeMetricTest.amloc_hash
16   - {:name => 'Analizo',
17   - :supported_metric => [total_cof_hash, amloc_hash]}
18   - end
  5 +class BaseToolTest < ActiveSupport::TestCase
19 6  
20 7 def setup
21   - @hash = self.class.analizo_hash
22   - @base_tool = self.class.analizo
  8 + @hash = BaseToolFixtures.analizo_hash
  9 + @base_tool = BaseToolFixtures.analizo
23 10 end
24 11  
25 12 should 'create base tool from hash' do
... ...