Commit a125df70e49b659b7050f8629e553e97b4a20fca
Committed by
Paulo Meireles
1 parent
11561bbf
Exists in
master
and in
28 other branches
[Mezuro] CompoundMetricWithErrorFixtures
Showing
2 changed files
with
19 additions
and
14 deletions
Show diff stats
plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb
0 → 100644
| ... | ... | @@ -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 | 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 | 7 | def setup |
| 17 | - @hash = self.class.fixture_hash | |
| 18 | - @entity = self.class.fixture | |
| 8 | + @hash = CompoundMetricWithErrorFixtures.create_hash | |
| 9 | + @entity = CompoundMetricWithErrorFixtures.create | |
| 19 | 10 | end |
| 20 | 11 | |
| 21 | 12 | should 'create error from hash' do | ... | ... |