Commit 38bd438ec4424a89fe98cbc0cb3049984f35ac4f

Authored by Carlos Morais
Committed by Paulo Meireles
1 parent 8d5d30fe

[Mezuro] ProjectFixtures

plugins/mezuro/test/fixtures/project_fixtures.rb 0 → 100644
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
  1 +class ProjectFixtures
  2 +
  3 + def self.qt_calculator
  4 + project = Kalibro::Entities::Project.new
  5 + project.name = 'Qt-Calculator'
  6 + project.license = 'GPL'
  7 + project.description = 'Calculator for Qt'
  8 + project.repository = RepositoryFixtures.qt_calculator
  9 + project.configuration_name = 'Kalibro for Java'
  10 + project.state = 'READY'
  11 + project
  12 + end
  13 +
  14 + def self.qt_calculator_hash
  15 + {:name => 'Qt-Calculator', :license => 'GPL', :description => 'Calculator for Qt',
  16 + :repository => RepositoryFixtures.qt_calculator_hash,
  17 + :configuration_name => 'Kalibro for Java', :state => 'READY'}
  18 + end
  19 +
  20 +end
plugins/mezuro/test/unit/kalibro/entities/project_test.rb
1 require "test_helper" 1 require "test_helper"
2 -class ProjectTest < ActiveSupport::TestCase  
3 2
4 - def self.qt_calculator  
5 - project = Kalibro::Entities::Project.new  
6 - project.name = 'Qt-Calculator'  
7 - project.license = 'GPL'  
8 - project.description = 'Calculator for Qt'  
9 - project.repository = RepositoryTest.qt_calculator  
10 - project.configuration_name = 'Kalibro for Java'  
11 - project.state = 'READY'  
12 - project  
13 - end 3 +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_fixtures"
14 4
15 - def self.qt_calculator_hash  
16 - {:name => 'Qt-Calculator', :license => 'GPL',  
17 - :description => 'Calculator for Qt',  
18 - :repository => RepositoryTest.qt_calculator_hash,  
19 - :configuration_name => 'Kalibro for Java',  
20 - :state => 'READY'}  
21 - end 5 +class ProjectTest < ActiveSupport::TestCase
22 6
23 def setup 7 def setup
24 - @hash = self.class.qt_calculator_hash  
25 - @project = self.class.qt_calculator 8 + @hash = ProjectFixtures.qt_calculator_hash
  9 + @project = ProjectFixtures.qt_calculator
26 end 10 end
27 11
28 should 'create project from hash' do 12 should 'create project from hash' do