diff options
author | Matt Robinson <matt@puppetlabs.com> | 2010-12-16 14:08:45 -0800 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2010-12-16 14:08:45 -0800 |
commit | b4035315aaad37df97d4e620b4f972cad201d04f (patch) | |
tree | 2be10cd07b1c8c45d63ec38adb7f35927841b864 | |
parent | d211dc9b7b756634d8bb568454d06aa6b0f66b5b (diff) | |
parent | d74e8e18047a4cbc2e77802324eb97a07a4ddb63 (diff) | |
download | puppet-b4035315aaad37df97d4e620b4f972cad201d04f.tar.gz puppet-b4035315aaad37df97d4e620b4f972cad201d04f.tar.xz puppet-b4035315aaad37df97d4e620b4f972cad201d04f.zip |
Merge branch 'ticket/2.6.next/maint-fix_active_record_confine' into 2.6.next
* ticket/2.6.next/maint-fix_active_record_confine:
maint: Fix ActiveRecord confine issue
-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 df61d59d7..ba8f1dad9 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 |