Commit 30519be044fe841b5029a0b3b985d8c44a425fef

Authored by Carlos Morais
1 parent a00d04a1

[Mezuro] RepositoryFixtures

plugins/mezuro/test/fixtures/repository_fixtures.rb 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +class RepositoryFixtures
  2 +
  3 + def self.qt_calculator
  4 + repository = Kalibro::Entities::Repository.new
  5 + repository.type = 'SUBVERSION'
  6 + repository.address = 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator'
  7 + repository
  8 + end
  9 +
  10 + def self.qt_calculator_hash
  11 + {:type => 'SUBVERSION', :address => 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator'}
  12 + end
  13 +
  14 +end
plugins/mezuro/test/unit/kalibro/entities/repository_test.rb
1 require "test_helper" 1 require "test_helper"
2 -class RepositoryTest < ActiveSupport::TestCase  
3 2
4 - def self.qt_calculator  
5 - repository = Kalibro::Entities::Repository.new  
6 - repository.type = 'SUBVERSION'  
7 - repository.address = 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator'  
8 - repository  
9 - end 3 +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/repository_fixtures"
10 4
11 - def self.qt_calculator_hash  
12 - {:type => 'SUBVERSION',  
13 - :address => 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator'}  
14 - end 5 +class RepositoryTest < ActiveSupport::TestCase
15 6
16 def setup 7 def setup
17 - @hash = self.class.qt_calculator_hash  
18 - @repository = self.class.qt_calculator 8 + @hash = RepositoryFixtures.qt_calculator_hash
  9 + @repository = RepositoryFixtures.qt_calculator
19 end 10 end
20 11
21 should 'create repository from hash' do 12 should 'create repository from hash' do