From: Tomas Sedovic tsedovic@redhat.com
A previous commit added explicit loading of the factories when running rake spec. However, when the factories are loaded automatically (as they sholud be), this breaks the tests.
This commit resets the previous change. --- src/spec/spec_helper.rb | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb index 4a72e06..5181389 100644 --- a/src/spec/spec_helper.rb +++ b/src/spec/spec_helper.rb @@ -13,9 +13,6 @@ require 'authlogic/test_case' # in ./support/ and its subdirectories. Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13) -Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f} - Spec::Runner.configure do |config| # If you're not using ActiveRecord you should remove these # lines, delete config/database.yml and disable :active_record
On Tue, 2010-07-20 at 17:27 +0200, tsedovic@redhat.com wrote:
From: Tomas Sedovic tsedovic@redhat.com
A previous commit added explicit loading of the factories when running rake spec. However, when the factories are loaded automatically (as they sholud be), this breaks the tests.
This commit resets the previous change.
src/spec/spec_helper.rb | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb index 4a72e06..5181389 100644 --- a/src/spec/spec_helper.rb +++ b/src/spec/spec_helper.rb @@ -13,9 +13,6 @@ require 'authlogic/test_case' # in ./support/ and its subdirectories. Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13) -Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f}
ACK, not sure why this worked for me on older patch when I tested it, but the above line kills specs for me now.
Spec::Runner.configure do |config| # If you're not using ActiveRecord you should remove these # lines, delete config/database.yml and disable :active_record
On 07/20/2010 10:47 PM, Jason Guiditta wrote:
On Tue, 2010-07-20 at 17:27 +0200, tsedovic@redhat.com wrote:
From: Tomas Sedovictsedovic@redhat.com
A previous commit added explicit loading of the factories when running rake spec. However, when the factories are loaded automatically (as they sholud be), this breaks the tests.
This commit resets the previous change.
src/spec/spec_helper.rb | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb index 4a72e06..5181389 100644 --- a/src/spec/spec_helper.rb +++ b/src/spec/spec_helper.rb @@ -13,9 +13,6 @@ require 'authlogic/test_case' # in ./support/ and its subdirectories. Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13) -Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f}
ACK, not sure why this worked for me on older patch when I tested it, but the above line kills specs for me now.
This problem is version-related, factories are not loaded when you use rails from rpm package, but when you use rails from gem, factories are loaded by factory_girl (I think). I'll look on this closer.
Jan
On 07/21/2010 09:37 AM, Jan Provaznik wrote:
On 07/20/2010 10:47 PM, Jason Guiditta wrote:
On Tue, 2010-07-20 at 17:27 +0200, tsedovic@redhat.com wrote:
From: Tomas Sedovictsedovic@redhat.com
A previous commit added explicit loading of the factories when running rake spec. However, when the factories are loaded automatically (as they sholud be), this breaks the tests.
This commit resets the previous change.
src/spec/spec_helper.rb | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb index 4a72e06..5181389 100644 --- a/src/spec/spec_helper.rb +++ b/src/spec/spec_helper.rb @@ -13,9 +13,6 @@ require 'authlogic/test_case' # in ./support/ and its subdirectories. Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13) -Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f}
ACK, not sure why this worked for me on older patch when I tested it, but the above line kills specs for me now.
This problem is version-related, factories are not loaded when you use rails from rpm package, but when you use rails from gem, factories are loaded by factory_girl (I think). I'll look on this closer.
Factories autoloading is fixed in newest factory_girl version 1.3.1, (it's this commit: http://github.com/thoughtbot/factory_girl/commit/eb8b7741485a0c90197776eb364...) and I've been using 1.3.0.
Tomas, what do you think about increasing version dependency for factory_girl in config/environments/test.rb to 1.3.1 with this commit?
Good catch, Jan.
I'm all for requiring factory_girl 1.3.1. It'll save us troubles with the tests and since there isn't a factory_girl RPM anyway, there's nothing forcing us to stay with 1.3.0.
Thomas
----- Original Message ----- From: "Jan Provaznik" jprovazn@redhat.com To: "Jason Guiditta" jguiditt@redhat.com Cc: deltacloud-devel@lists.fedorahosted.org Sent: Friday, July 23, 2010 10:25:43 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: [deltacloud-devel] [PATCH aggregator] Fix Factory::DuplicateDefinitionError in rake spec.
On 07/21/2010 09:37 AM, Jan Provaznik wrote:
On 07/20/2010 10:47 PM, Jason Guiditta wrote:
On Tue, 2010-07-20 at 17:27 +0200, tsedovic@redhat.com wrote:
From: Tomas Sedovictsedovic@redhat.com
A previous commit added explicit loading of the factories when running rake spec. However, when the factories are loaded automatically (as they sholud be), this breaks the tests.
This commit resets the previous change.
src/spec/spec_helper.rb | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb index 4a72e06..5181389 100644 --- a/src/spec/spec_helper.rb +++ b/src/spec/spec_helper.rb @@ -13,9 +13,6 @@ require 'authlogic/test_case' # in ./support/ and its subdirectories. Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13) -Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f}
ACK, not sure why this worked for me on older patch when I tested it, but the above line kills specs for me now.
This problem is version-related, factories are not loaded when you use rails from rpm package, but when you use rails from gem, factories are loaded by factory_girl (I think). I'll look on this closer.
Factories autoloading is fixed in newest factory_girl version 1.3.1, (it's this commit: http://github.com/thoughtbot/factory_girl/commit/eb8b7741485a0c90197776eb364...) and I've been using 1.3.0.
Tomas, what do you think about increasing version dependency for factory_girl in config/environments/test.rb to 1.3.1 with this commit? _______________________________________________ deltacloud-devel mailing list deltacloud-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/deltacloud-devel
On Fri, 2010-07-23 at 04:58 -0400, Tomas Sedovic wrote:
Good catch, Jan.
I'm all for requiring factory_girl 1.3.1. It'll save us troubles with the tests and since there isn't a factory_girl RPM anyway, there's nothing forcing us to stay with 1.3.0.
Thomas
I've updated the wiki page (http://deltacloud.org/page/Packaging_list) with that version, so whoever gets around to packaging it will use the right one. If you update environment files, please make sure to get both cucumber.rb and test.rb.
-j
deltacloud-devel@lists.fedorahosted.org