Commit cdc437316408c3283df7344044d89bd7c33be159

Authored by Carlos Morais
1 parent 42e15772

CompoundMetricWithErrorFixtures

plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +class CompoundMetricWithErrorFixtures
  2 +
  3 + def self.create
  4 + fixture = Kalibro::Entities::CompoundMetricWithError.new
  5 + fixture.metric = CompoundMetricFixtures.sc
  6 + fixture.error = ErrorFixtures.create
  7 + fixture
  8 + end
  9 +
  10 + def self.create_hash
  11 + {:metric => CompoundMetricFixtures.sc_hash, :error => ErrorFixtures.create_hash}
  12 + end
  13 +
  14 +end
plugins/mezuro/test/unit/kalibro/entities/compound_metric_with_error_test.rb
1 require "test_helper" 1 require "test_helper"
2 -class CompoundMetricWithErrorTest < ActiveSupport::TestCase  
3 -  
4 - def self.fixture  
5 - fixture = Kalibro::Entities::CompoundMetricWithError.new  
6 - fixture.metric = CompoundMetricTest.sc  
7 - fixture.error = ErrorTest.fixture  
8 - fixture  
9 - end  
10 2
11 - def self.fixture_hash  
12 - {:metric => CompoundMetricTest.sc_hash,  
13 - :error => ErrorTest.fixture_hash}  
14 - end 3 +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures"
15 4
  5 +class CompoundMetricWithErrorTest < ActiveSupport::TestCase
  6 +
16 def setup 7 def setup
17 - @hash = self.class.fixture_hash  
18 - @entity = self.class.fixture 8 + @hash = CompoundMetricWithErrorFixtures.create_hash
  9 + @entity = CompoundMetricWithErrorFixtures.create
19 end 10 end
20 11
21 should 'create error from hash' do 12 should 'create error from hash' do