diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-12-16 15:06:31 -0800 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2010-12-16 15:06:31 -0800 |
| commit | 9b2b4aebed29f035415c1f7324943d3ba2993ea2 (patch) | |
| tree | 18baf44cc35011d0afca34eb75daeb3c5b87a1fb | |
| parent | a2ff092d8302e09aa79f9bb16636f8298316c3c7 (diff) | |
| parent | fb8509acbd947712cac094a49227d28a16a366aa (diff) | |
| download | puppet-9b2b4aebed29f035415c1f7324943d3ba2993ea2.tar.gz puppet-9b2b4aebed29f035415c1f7324943d3ba2993ea2.tar.xz puppet-9b2b4aebed29f035415c1f7324943d3ba2993ea2.zip | |
Merge branch 'next'
* next:
maint: Fix ActiveRecord confine issue
maint: Fix a test that was missing a require
maint: Fix tests that don't run on their own
| -rwxr-xr-x | spec/unit/indirector/catalog/active_record_spec.rb | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/spec/unit/indirector/catalog/active_record_spec.rb b/spec/unit/indirector/catalog/active_record_spec.rb index 71975f014..27310e48e 100755 --- a/spec/unit/indirector/catalog/active_record_spec.rb +++ b/spec/unit/indirector/catalog/active_record_spec.rb @@ -7,20 +7,23 @@ describe "Puppet::Resource::Catalog::ActiveRecord" do confine "Missing Rails" => Puppet.features.rails? require 'puppet/rails' - class Tableless < ActiveRecord::Base - def self.columns - @columns ||= [] - end - def self.column(name, sql_type=nil, default=nil, null=true) - columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) + + before :all do + class Tableless < ActiveRecord::Base + def self.columns + @columns ||= [] + end + def self.column(name, sql_type=nil, default=nil, null=true) + columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) + end end - end - class Host < Tableless - column :name, :string, :null => false - column :ip, :string - column :environment, :string - column :last_compile, :datetime + class Host < Tableless + column :name, :string, :null => false + column :ip, :string + column :environment, :string + column :last_compile, :datetime + end end before do |
