From cdc437316408c3283df7344044d89bd7c33be159 Mon Sep 17 00:00:00 2001 From: Carlos Morais Date: Thu, 9 Feb 2012 18:56:37 -0200 Subject: [PATCH] CompoundMetricWithErrorFixtures --- plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb | 14 ++++++++++++++ plugins/mezuro/test/unit/kalibro/entities/compound_metric_with_error_test.rb | 19 +++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb diff --git a/plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb b/plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb new file mode 100644 index 0000000..182b9c9 --- /dev/null +++ b/plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures.rb @@ -0,0 +1,14 @@ +class CompoundMetricWithErrorFixtures + + def self.create + fixture = Kalibro::Entities::CompoundMetricWithError.new + fixture.metric = CompoundMetricFixtures.sc + fixture.error = ErrorFixtures.create + fixture + end + + def self.create_hash + {:metric => CompoundMetricFixtures.sc_hash, :error => ErrorFixtures.create_hash} + end + +end diff --git a/plugins/mezuro/test/unit/kalibro/entities/compound_metric_with_error_test.rb b/plugins/mezuro/test/unit/kalibro/entities/compound_metric_with_error_test.rb index e764843..22a3eed 100644 --- a/plugins/mezuro/test/unit/kalibro/entities/compound_metric_with_error_test.rb +++ b/plugins/mezuro/test/unit/kalibro/entities/compound_metric_with_error_test.rb @@ -1,21 +1,12 @@ require "test_helper" -class CompoundMetricWithErrorTest < ActiveSupport::TestCase - - def self.fixture - fixture = Kalibro::Entities::CompoundMetricWithError.new - fixture.metric = CompoundMetricTest.sc - fixture.error = ErrorTest.fixture - fixture - end - def self.fixture_hash - {:metric => CompoundMetricTest.sc_hash, - :error => ErrorTest.fixture_hash} - end +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures" +class CompoundMetricWithErrorTest < ActiveSupport::TestCase + def setup - @hash = self.class.fixture_hash - @entity = self.class.fixture + @hash = CompoundMetricWithErrorFixtures.create_hash + @entity = CompoundMetricWithErrorFixtures.create end should 'create error from hash' do -- libgit2 0.21.2