Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 9 commits
  • 37 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 15, 2012
@msavy msavy [BGBUILD-346] Fixes to enable Ruby 1.9 compatibility:
- Include path changes from 1.8 -> 1.9.
- Fix reliance on undefined behaviour/quirk in 1.8.x bindings
  (Kernel#binding).
  - See: http://bugs.ruby-lang.org/issues/2161
- Ensure boxgrinder-core compat patches are included before we do
  anything meaningful.
- Refactor reliance on string #each with implicit \n splitting.
- Refactor broken specs.
- Refactor weird/fragile/undefined code usage.

[BGBUILD-348] Testing changes and fixes:
- Enable simplecov for spec:coverage >=1.9, yay! Rcov will still run
  for Ruby 1.8.
- Ensures that boxgrinder-core compat patches are included before
  tests are run.
af42eb9
Commits on Feb 22, 2012
@msavy msavy Update Manifest ac00467
@msavy msavy Use RbConfig, as Config is deprecated as of 1.9.x c2f71d9
@msavy msavy Do not run specs that fail on older rspec-matchers (see bug: rspec/rs… c9fd1e8
@msavy msavy Remove redundant require statements 71a1ab2
@msavy msavy Ensure rcov includes rubygems and rcov first. 1.8 only
Use this workaround: rspec/rspec-core#370 (comment)
947c256
@msavy msavy Use simpler relative path to keep CI happy. 75d8580
Commits on Feb 23, 2012
@msavy msavy Avoid weird Rakeiness ead04dc
@msavy msavy Looks like RSpec automagically handles rcov 884980e
Showing with 95 additions and 106 deletions.
  1. +10 −1 Manifest
  2. +11 −6 Rakefile
  3. +2 −2 bin/boxgrinder-build
  4. +2 −1  lib/boxgrinder-build.rb
  5. +1 −1  lib/boxgrinder-build/helpers/guestfs-helper.rb
  6. +3 −3 lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb
  7. +5 −1 lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb
  8. +1 −1  lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb
  9. +1 −1  lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb
  10. +19 −16 spec/appliance-spec.rb
  11. +0 −2  spec/helpers/augeas-helper-spec.rb
  12. +1 −3 spec/helpers/guestfs-helper-spec.rb
  13. +0 −2  spec/helpers/image-helper-spec.rb
  14. +0 −2  spec/helpers/linux-helper-spec.rb
  15. +0 −2  spec/helpers/package-helper-spec.rb
  16. +0 −2  spec/helpers/plugin-helper-spec.rb
  17. +0 −2  spec/helpers/s3-helper-spec.rb
  18. +0 −2  spec/managers/plugin-manager-spec.rb
  19. +0 −2  spec/plugins/base-plugin-spec.rb
  20. +0 −2  spec/plugins/delivery/ebs/ebs-plugin-spec.rb
  21. +0 −2  spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb
  22. +0 −2  spec/plugins/delivery/local/local-plugin-spec.rb
  23. +0 −2  spec/plugins/delivery/s3/s3-plugin-spec.rb
  24. +0 −2  spec/plugins/delivery/sftp/sftp-plugin-spec.rb
  25. +0 −2  spec/plugins/os/centos/centos-plugin-spec.rb
  26. +0 −2  spec/plugins/os/fedora/fedora-plugin-spec.rb
  27. +0 −2  spec/plugins/os/rhel/rhel-plugin-spec.rb
  28. +0 −2  spec/plugins/os/rpm-based/kickstart-spec.rb
  29. +0 −2  spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb
  30. +0 −2  spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb
  31. +0 −2  spec/plugins/platform/ec2/ec2-plugin-spec.rb
  32. +1 −3 spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb
  33. +0 −1  spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb
  34. +25 −24 spec/plugins/platform/vmware/vmware-plugin-spec.rb
  35. +2 −0  spec/rcov_helper.rb
  36. +9 −0 spec/spec_helper.rb
  37. +2 −2 spec/util/permissions/fs-observer-spec.rb
View
11 Manifest
@@ -5,7 +5,6 @@ README.md
Rakefile
bash_completion
bin/boxgrinder-build
-boxgrinder-build.gemspec
integ/appliances/gnome-fedora.appl
integ/appliances/jeos-centos5-files.appl
integ/appliances/jeos-centos5.appl
@@ -79,6 +78,10 @@ lib/boxgrinder-build/plugins/platform/vmware/src/README-personal
lib/boxgrinder-build/plugins/platform/vmware/src/base.vmdk
lib/boxgrinder-build/plugins/platform/vmware/src/base.vmx
lib/boxgrinder-build/plugins/platform/vmware/vmware-plugin.rb
+lib/boxgrinder-build/util/concurrent/get_set.rb
+lib/boxgrinder-build/util/permissions/fs-monitor.rb
+lib/boxgrinder-build/util/permissions/fs-observer.rb
+lib/boxgrinder-build/util/permissions/user-switcher.rb
rubygem-boxgrinder-build.spec
spec/appliance-spec.rb
spec/helpers/augeas-helper-spec.rb
@@ -116,4 +119,10 @@ spec/plugins/platform/ec2/ec2-plugin-spec.rb
spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb
spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb
spec/plugins/platform/vmware/vmware-plugin-spec.rb
+spec/rcov_helper.rb
spec/rspec-plugin-helper.rb
+spec/spec_helper.rb
+spec/util/concurrent/get-set-spec.rb
+spec/util/permissions/fs-monitor-spec.rb
+spec/util/permissions/fs-observer-spec.rb
+spec/util/permissions/user-switcher-spec.rb
View
17 Rakefile
@@ -40,7 +40,7 @@ desc "Run all integration tests"
RSpec::Core::RakeTask.new('integ') do |t|
t.rcov = false
t.pattern = "integ/**/*-spec.rb"
- t.rspec_opts = ['--colour', '--format', 'doc', '-b']
+ t.rspec_opts = ['-r boxgrinder-core', '-r rubygems', '--colour', '--format', 'doc', '-b']
t.verbose = true
end
@@ -49,16 +49,21 @@ RSpec::Core::RakeTask.new('spec') do |t|
t.ruby_opts = "-I ../boxgrinder-core/lib"
t.rcov = false
t.pattern = "spec/**/*-spec.rb"
- t.rspec_opts = ['--colour', '--format', 'doc', '-b']
+ t.rspec_opts = ['-r boxgrinder-core', '-r rubygems', '--colour', '--format', 'doc', '-b']
t.verbose = true
end
-desc "Run all tests and generate code coverage report"
RSpec::Core::RakeTask.new('spec:coverage') do |t|
t.ruby_opts = "-I ../boxgrinder-core/lib"
t.pattern = "spec/**/*-spec.rb"
- t.rspec_opts = ['--colour', '--format', 'html', '--out', 'pkg/rspec_report.html', '-b']
- t.rcov = true
- t.rcov_opts = ['--exclude', 'spec,teamcity/*,/usr/lib/ruby/,.gem/ruby,/boxgrinder-core/,/gems/']
+ t.rspec_opts = ['-r spec_helper', '-r boxgrinder-core', '-r rubygems', '--colour',
+ '--format', 'html', '--out', 'pkg/rspec_report.html', '-b']
t.verbose = true
+
+ if RUBY_VERSION =~ /^1.8/
+ t.rcov = true
+ t.rcov_opts = ["-Ispec:lib spec/rcov_helper.rb", '--exclude', 'spec,teamcity/*,/usr/lib/ruby/,.gem/ruby,/boxgrinder-build/,/gems/']
+ else
+ ENV['COVERAGE'] = 'true'
+ end
end
View
4 bin/boxgrinder-build
@@ -164,8 +164,8 @@ def ensure_root
unless Process.uid == 0
puts("Currently running as non-root user, BoxGrinder will re-launch under `sudo -E` and change to your local user after the OS plugin.")
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/151376
- ruby = File.join(Config::CONFIG["bindir"],
- Config::CONFIG["RUBY_INSTALL_NAME"] + Config::CONFIG["EXEEXT"])
+ ruby = File.join(RbConfig::CONFIG["bindir"],
+ RbConfig::CONFIG["RUBY_INSTALL_NAME"] + RbConfig::CONFIG["EXEEXT"])
exec("sudo -E #{ruby} -I#{$:.join(':')} #{Pathname.new(__FILE__).realpath} #{ARGV_DUP.join(" ")} --change-to-user")
end
end
View
3  lib/boxgrinder-build.rb
@@ -16,4 +16,5 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'boxgrinder-build/appliance'
+require 'boxgrinder-core'
+require 'boxgrinder-build/appliance'
View
2  lib/boxgrinder-build/helpers/guestfs-helper.rb
@@ -27,7 +27,7 @@
module BoxGrinder
class GuestFSHelper
def initialize(disks, appliance_config, config, options = {})
- @disks = disks
+ @disks = Array(disks)
@appliance_config = appliance_config
@config = config
@log = options[:log] || LogHelper.new
View
6 lib/boxgrinder-build/plugins/delivery/openstack/openstack-plugin.rb
@@ -68,12 +68,12 @@ def disk_and_container_format
if @previous_plugin_info[:type] == :platform
case @previous_plugin_info[:name]
- when :ec2:
+ when :ec2
disk_format = :ami
container_format = :ami
- when :vmware:
+ when :vmware
disk_format = :vmdk
- when :virtualbox:
+ when :virtualbox
disk_format = :vmdk
end
end
View
6 lib/boxgrinder-build/plugins/os/rpm-based/kickstart.rb
@@ -37,7 +37,7 @@ def initialize(config, appliance_config, dir, options = {})
def create
template = "#{File.dirname(__FILE__)}/src/appliance.ks.erb"
- kickstart = ERB.new(File.read(template)).result(build_definition.send(:binding))
+ kickstart = ERB.new(File.read(template)).result(build_definition.get_binding)
File.open(@kickstart_file, 'w') { |f| f.write(kickstart) }
@kickstart_file
@@ -54,6 +54,10 @@ def definition.method_missing(sym, * args)
self[sym.to_s]
end
+ def definition.get_binding
+ binding
+ end
+
cost = 40
definition['mount_points'] = @linux_helper.partition_mount_points(@appliance_config.hardware.partitions)
View
2  lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb
@@ -147,7 +147,7 @@ def cleanup_after_appliance_creator(pid)
@log.debug "Cleaning appliance-creator mount points..."
Dir["#{@dir.tmp}/imgcreate-*"].each do |dir|
- dev_mapper = @exec_helper.execute "mount | grep #{dir} | awk '{print $1}'"
+ dev_mapper = @exec_helper.execute("mount | grep #{dir} | awk '{print $1}'").split("\n")
mappings = {}
View
2  lib/boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator.rb
@@ -80,7 +80,7 @@ def invalid_names( repo_list, package_list )
for name in package_list
found = false
- repoquery_output.each do |line|
+ repoquery_output.each_line do |line|
line = line.strip
package = line.match( /^([\S]+)-\d+:/ )
View
35 spec/appliance-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/appliance'
require 'ostruct'
require 'logger'
@@ -233,6 +231,11 @@ def prepare_appliance_config
describe ".initialize_plugins" do
let(:os_plugin){ mock("OSPlugin") }
+
+ let(:os_plugin_info_mock){ mock('os_plugin_info_mock', :[] => 'os').as_null_object }
+ let(:platform_plugin_info_mock){ mock('platform_plugin_info_mock', :[] => 'plat').as_null_object }
+ let(:delivery_plugin_info_mock){ mock('delivery_plugin_info_mock', :[] => 'deliver').as_null_object }
+
let(:platform_plugin){ mock("PlatformPlugin", :deliverables => OpenCascade.new(:disk => 'a/disk.vmdk')) }
let(:delivery_plugin){ mock("DeliveryPlugin", :deliverables => {}) }
@@ -240,12 +243,12 @@ def prepare_appliance_config
prepare_appliance(:platform => :vmware)
@appliance.instance_variable_set(:@appliance_config, prepare_appliance_config)
- @plugin_manager.should_receive(:initialize_plugin).with(:os, :fedora).and_return([os_plugin, "os_plugin_info"])
- @plugin_manager.should_receive(:initialize_plugin).with(:platform, :vmware).and_return([platform_plugin, "platform_plugin_info"])
+ @plugin_manager.should_receive(:initialize_plugin).with(:os, :fedora).and_return([os_plugin, os_plugin_info_mock])
+ @plugin_manager.should_receive(:initialize_plugin).with(:platform, :vmware).and_return([platform_plugin, platform_plugin_info_mock])
@plugin_manager.should_not_receive(:initialize_plugin).with(:delivery, anything)
- os_plugin.should_receive(:init).with(@config, @appliance_config, "os_plugin_info", :log => @log)
- platform_plugin.should_receive(:init).with(@config, @appliance_config, "platform_plugin_info", :log => @log, :previous_plugin => os_plugin)
+ os_plugin.should_receive(:init).with(@config, @appliance_config, os_plugin_info_mock, :log => @log)
+ platform_plugin.should_receive(:init).with(@config, @appliance_config, platform_plugin_info_mock, :log => @log, :previous_plugin => os_plugin)
@appliance.initialize_plugins
@@ -257,13 +260,13 @@ def prepare_appliance_config
prepare_appliance(:platform => :vmware, :delivery => :s3)
@appliance.instance_variable_set(:@appliance_config, prepare_appliance_config)
- @plugin_manager.should_receive(:initialize_plugin).with(:os, :fedora).and_return([os_plugin, "os_plugin_info"])
- @plugin_manager.should_receive(:initialize_plugin).with(:platform, :vmware).and_return([platform_plugin, "platform_plugin_info"])
- @plugin_manager.should_receive(:initialize_plugin).with(:delivery, :s3).and_return([delivery_plugin, "delivery_plugin_info"])
+ @plugin_manager.should_receive(:initialize_plugin).with(:os, :fedora).and_return([os_plugin, os_plugin_info_mock])
+ @plugin_manager.should_receive(:initialize_plugin).with(:platform, :vmware).and_return([platform_plugin, platform_plugin_info_mock])
+ @plugin_manager.should_receive(:initialize_plugin).with(:delivery, :s3).and_return([delivery_plugin, delivery_plugin_info_mock])
- os_plugin.should_receive(:init).with(@config, @appliance_config, "os_plugin_info", :log => @log)
- platform_plugin.should_receive(:init).with(@config, @appliance_config, "platform_plugin_info", :log => @log, :previous_plugin => os_plugin)
- delivery_plugin.should_receive(:init).with(@config, @appliance_config, "delivery_plugin_info", :log => @log, :previous_plugin => platform_plugin, :type => :s3)
+ os_plugin.should_receive(:init).with(@config, @appliance_config, os_plugin_info_mock, :log => @log)
+ platform_plugin.should_receive(:init).with(@config, @appliance_config, platform_plugin_info_mock, :log => @log, :previous_plugin => os_plugin)
+ delivery_plugin.should_receive(:init).with(@config, @appliance_config, delivery_plugin_info_mock, :log => @log, :previous_plugin => platform_plugin, :type => :s3)
@appliance.initialize_plugins
@@ -275,12 +278,12 @@ def prepare_appliance_config
prepare_appliance(:delivery => :s3)
@appliance.instance_variable_set(:@appliance_config, prepare_appliance_config)
- @plugin_manager.should_receive(:initialize_plugin).with(:os, :fedora).and_return([os_plugin, "os_plugin_info"])
- @plugin_manager.should_receive(:initialize_plugin).with(:delivery, :s3).and_return([delivery_plugin, "delivery_plugin_info"])
+ @plugin_manager.should_receive(:initialize_plugin).with(:os, :fedora).and_return([os_plugin, os_plugin_info_mock])
+ @plugin_manager.should_receive(:initialize_plugin).with(:delivery, :s3).and_return([delivery_plugin, delivery_plugin_info_mock])
@plugin_manager.should_not_receive(:initialize_plugin).with(:platform, anything)
- os_plugin.should_receive(:init).with(@config, @appliance_config, "os_plugin_info", :log => @log)
- delivery_plugin.should_receive(:init).with(@config, @appliance_config, "delivery_plugin_info", :log => @log, :previous_plugin => os_plugin, :type => :s3)
+ os_plugin.should_receive(:init).with(@config, @appliance_config, os_plugin_info_mock, :log => @log)
+ delivery_plugin.should_receive(:init).with(@config, @appliance_config, delivery_plugin_info_mock, :log => @log, :previous_plugin => os_plugin, :type => :s3)
@appliance.initialize_plugins
end
View
2  spec/helpers/augeas-helper-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/helpers/augeas-helper'
module BoxGrinder
View
4 spec/helpers/guestfs-helper-spec.rb
@@ -17,8 +17,6 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
require 'boxgrinder-build/helpers/guestfs-helper'
-require 'rubygems'
-require 'rspec'
require 'hashery/opencascade'
module BoxGrinder
@@ -56,7 +54,7 @@ module BoxGrinder
end
end
- it "should prepare and run guestfs wid IDE disk" do
+ it "should prepare and run guestfs with IDE disk" do
guestfs = mock('Guestfs')
@helper.instance_variable_set(:@guestfs, guestfs)
View
2  spec/helpers/image-helper-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/helpers/image-helper'
module BoxGrinder
View
2  spec/helpers/linux-helper-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/helpers/linux-helper'
module BoxGrinder
View
2  spec/helpers/package-helper-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'logger'
require 'boxgrinder-build/helpers/package-helper'
View
2  spec/helpers/plugin-helper-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-core/helpers/log-helper'
require 'boxgrinder-build/helpers/plugin-helper'
require 'ostruct'
View
2  spec/helpers/s3-helper-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/helpers/s3-helper'
require 'aws-sdk'
View
2  spec/managers/plugin-manager-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/managers/plugin-manager'
module BoxGrinder
View
2  spec/plugins/base-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/base-plugin'
require 'boxgrinder-core/helpers/log-helper'
require 'yaml'
View
2  spec/plugins/delivery/ebs/ebs-plugin-spec.rb
@@ -17,8 +17,6 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
require 'boxgrinder-build/plugins/delivery/ebs/ebs-plugin'
-require 'rubygems'
-require 'rspec'
require 'ostruct'
require 'logger'
require 'set'
View
2  spec/plugins/delivery/elastichosts/elastichosts-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'hashery/opencascade'
require 'boxgrinder-build/plugins/delivery/elastichosts/elastichosts-plugin'
View
2  spec/plugins/delivery/local/local-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/delivery/local/local-plugin'
require 'hashery/opencascade'
View
2  spec/plugins/delivery/s3/s3-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/delivery/s3/s3-plugin'
require 'hashery/opencascade'
require 'boxgrinder-core/models/config'
View
2  spec/plugins/delivery/sftp/sftp-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/delivery/sftp/sftp-plugin'
module BoxGrinder
View
2  spec/plugins/os/centos/centos-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/os/centos/centos-plugin'
require 'hashery/opencascade'
View
2  spec/plugins/os/fedora/fedora-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/os/fedora/fedora-plugin'
require 'hashery/opencascade'
View
2  spec/plugins/os/rhel/rhel-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/os/rhel/rhel-plugin'
require 'hashery/opencascade'
View
2  spec/plugins/os/rpm-based/kickstart-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/os/rpm-based/kickstart'
require 'hashery/opencascade'
View
2  spec/plugins/os/rpm-based/rpm-based-os-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin'
require 'hashery/opencascade'
View
2  spec/plugins/os/rpm-based/rpm-dependency-validator-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/os/rpm-based/rpm-dependency-validator'
require 'hashery/opencascade'
View
2  spec/plugins/platform/ec2/ec2-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/platform/ec2/ec2-plugin'
require 'boxgrinder-core/helpers/log-helper'
require 'hashery/opencascade'
View
4 spec/plugins/platform/virtualbox/virtualbox-plugin-spec.rb
@@ -16,11 +16,9 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/platform/virtualbox/virtualbox-plugin'
require 'hashery/opencascade'
-require 'spec/rspec-plugin-helper.rb'
+require 'rspec-plugin-helper'
module BoxGrinder
describe VirtualBoxPlugin do
View
1  spec/plugins/platform/virtualpc/virtualpc-plugin-spec.rb
@@ -16,7 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
require 'boxgrinder-build/plugins/platform/virtualpc/virtualpc-plugin.rb'
module BoxGrinder
View
49 spec/plugins/platform/vmware/vmware-plugin-spec.rb
@@ -16,8 +16,6 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-require 'rubygems'
-require 'rspec'
require 'boxgrinder-build/plugins/platform/vmware/vmware-plugin'
require 'hashery/opencascade'
@@ -122,7 +120,7 @@ def prepare_image(plugin_config, options = {})
vmdk_image = @plugin.change_vmdk_values("vmfs")
- vmdk_image.scan(/^createType="(.*)"\s?$/).to_s.should == "vmfs"
+ vmdk_image.match(/^createType="(.*)"\s?$/)[1].should == "vmfs"
disk_attributes = vmdk_image.scan(/^RW (.*) (.*) "(.*).raw" (.*)\s?$/)[0]
@@ -131,11 +129,11 @@ def prepare_image(plugin_config, options = {})
disk_attributes[2].should == "full"
disk_attributes[3].should == ""
- vmdk_image.scan(/^ddb.geometry.cylinders = "(.*)"\s?$/).to_s.should == "652"
- vmdk_image.scan(/^ddb.geometry.heads = "(.*)"\s?$/).to_s.should == "255"
- vmdk_image.scan(/^ddb.geometry.sectors = "(.*)"\s?$/).to_s.should == "63"
+ vmdk_image.match(/^ddb.geometry.cylinders = "(.*)"\s?$/)[1].should == "652"
+ vmdk_image.match(/^ddb.geometry.heads = "(.*)"\s?$/)[1].should == "255"
+ vmdk_image.match(/^ddb.geometry.sectors = "(.*)"\s?$/)[1].should == "63"
- vmdk_image.scan(/^ddb.virtualHWVersion = "(.*)"\s?$/).to_s.should == "7"
+ vmdk_image.match(/^ddb.virtualHWVersion = "(.*)"\s?$/)[1].should == "7"
end
it "should change vmdk data (flat)" do
@@ -145,7 +143,7 @@ def prepare_image(plugin_config, options = {})
vmdk_image = @plugin.change_vmdk_values("monolithicFlat")
- vmdk_image.scan(/^createType="(.*)"\s?$/).to_s.should == "monolithicFlat"
+ vmdk_image.match(/^createType="(.*)"\s?$/)[1].should == "monolithicFlat"
disk_attributes = vmdk_image.scan(/^RW (.*) (.*) "(.*).raw" (.*)\s?$/)[0]
@@ -154,12 +152,12 @@ def prepare_image(plugin_config, options = {})
disk_attributes[2].should == "full"
disk_attributes[3].should == "0"
- vmdk_image.scan(/^ddb.geometry.cylinders = "(.*)"\s?$/).to_s.should == "652"
- vmdk_image.scan(/^ddb.geometry.heads = "(.*)"\s?$/).to_s.should == "255"
- vmdk_image.scan(/^ddb.geometry.sectors = "(.*)"\s?$/).to_s.should == "63"
+ vmdk_image.match(/^ddb.geometry.cylinders = "(.*)"\s?$/)[1].should == "652"
+ vmdk_image.match(/^ddb.geometry.heads = "(.*)"\s?$/)[1].should == "255"
+ vmdk_image.match(/^ddb.geometry.sectors = "(.*)"\s?$/)[1].should == "63"
- vmdk_image.scan(/^ddb.virtualHWVersion = "(.*)"\s?$/).to_s.should == "7"
- vmdk_image.scan(/^ddb.thinProvisioned = "(.*)"\s?$/).to_s.should == "0"
+ vmdk_image.match(/^ddb.virtualHWVersion = "(.*)"\s?$/)[1].should == "7"
+ vmdk_image.match(/^ddb.thinProvisioned = "(.*)"\s?$/)[1].should == "0"
end
it "should change vmdk data (flat) enabling thin disk" do
@@ -169,7 +167,7 @@ def prepare_image(plugin_config, options = {})
vmdk_image = @plugin.change_vmdk_values("monolithicFlat")
- vmdk_image.scan(/^ddb.thinProvisioned = "(.*)"\s?$/).to_s.should == "1"
+ vmdk_image.match(/^ddb.thinProvisioned = "(.*)"\s?$/)[1].should == "1"
end
end
@@ -177,16 +175,19 @@ def prepare_image(plugin_config, options = {})
prepare_image({'thin_disk' => false, 'type' => 'enterprise'})
vmx_file = @plugin.change_common_vmx_values
-
- vmx_file.scan(/^guestOS = "(.*)"\s?$/).to_s.should == "linux"
- vmx_file.scan(/^displayName = "(.*)"\s?$/).to_s.should == "full"
- vmx_file.scan(/^annotation = "(.*)"\s?$/).to_s.scan(/^full | Version: 1\.0 | Built by: BoxGrinder 1\.0\.0/).should_not == nil
- vmx_file.scan(/^guestinfo.vmware.product.long = "(.*)"\s?$/).to_s.should == "full"
- vmx_file.scan(/^guestinfo.vmware.product.url = "(.*)"\s?$/).to_s.should == "http://boxgrinder.org"
- vmx_file.scan(/^numvcpus = "(.*)"\s?$/).to_s.should == "1"
- vmx_file.scan(/^memsize = "(.*)"\s?$/).to_s.should == "256"
- vmx_file.scan(/^log.fileName = "(.*)"\s?$/).to_s.should == "full.log"
- vmx_file.scan(/^scsi0:0.fileName = "(.*)"\s?$/).to_s.should == "full.vmdk"
+
+ vmx_file.match(/^guestOS = "(.*)"\s?$/)[1].should == "linux"
+ vmx_file.match(/^displayName = "(.*)"\s?$/)[1].should == "full"
+
+ vmx_file.match(/^annotation = "(.*)"\s?$/)[1].
+ match(/^full | Version: 1\.0 | Built by: BoxGrinder 1\.0\.0/).should_not == nil
+
+ vmx_file.match(/^guestinfo.vmware.product.long = "(.*)"\s?$/)[1].should == "full"
+ vmx_file.match(/^guestinfo.vmware.product.url = "(.*)"\s?$/)[1].should == "http://boxgrinder.org"
+ vmx_file.match(/^numvcpus = "(.*)"\s?$/)[1].should == "1"
+ vmx_file.match(/^memsize = "(.*)"\s?$/)[1].should == "256"
+ vmx_file.match(/^log.fileName = "(.*)"\s?$/)[1].should == "full.log"
+ vmx_file.match(/^scsi0:0.fileName = "(.*)"\s?$/)[1].should == "full.vmdk"
end
describe ".build_vmware_personal" do
View
2  spec/rcov_helper.rb
@@ -0,0 +1,2 @@
+require 'rubygems'
+require 'rspec'
View
9 spec/spec_helper.rb
@@ -0,0 +1,9 @@
+if ENV['COVERAGE']
+ require 'simplecov'
+
+ FILTER_DIRS = ['spec']
+
+ SimpleCov.start do
+ FILTER_DIRS.each{ |f| add_filter f }
+ end
+end
View
4 spec/util/permissions/fs-observer-spec.rb
@@ -50,12 +50,12 @@ module BoxGrinder
path_update(subject, '/the/great/escape')
end
- it "should add the path to the path_set" do
+ it "should add the path to the path_set", :if => RSpec::Expectations::Version::STRING >= "2.7.0" do
expect{ simple_update }.to change(subject, :path_set).
from(empty_set).to(mkset('/the/great/escape'))
end
- it "should add regex for all children of new path to the filter_set" do
+ it "should add regex for all children of new path to the filter_set", :if => RSpec::Expectations::Version::STRING >= "2.7.0" do
expect_set = init_filterset + mkset(%r[^/the/great/escape/])
expect{ simple_update }.to change(subject, :filter_set).

No commit comments for this range

Something went wrong with that request. Please try again.