diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-12-16 14:02:11 -0800 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2010-12-16 14:08:18 -0800 |
| commit | d74e8e18047a4cbc2e77802324eb97a07a4ddb63 (patch) | |
| tree | 2be10cd07b1c8c45d63ec38adb7f35927841b864 | |
| parent | d211dc9b7b756634d8bb568454d06aa6b0f66b5b (diff) | |
| download | puppet-d74e8e18047a4cbc2e77802324eb97a07a4ddb63.tar.gz puppet-d74e8e18047a4cbc2e77802324eb97a07a4ddb63.tar.xz puppet-d74e8e18047a4cbc2e77802324eb97a07a4ddb63.zip | |
maint: Fix ActiveRecord confine issue
We made a class that inherited from ActiveRecord, but did so outside a
block so the confine wasn't skipping it when ActiveRecord wasn't
installed. Moving that class inside a before block caused the confine
to work properly.
Paired-with: Nick Lewis
| -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 |
