vagrant 1.0.7 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -43
- data/Gemfile +2 -1
- data/LICENSE.txt +22 -0
- data/README.md +3 -90
- data/Rakefile +1 -18
- data/bin/vagrant +2 -58
- data/message.txt +17 -0
- data/vagrant.gemspec +20 -69
- metadata +43 -655
- data/.yardopts +0 -1
- data/CHANGELOG.md +0 -723
- data/LICENSE +0 -21
- data/config/default.rb +0 -30
- data/contrib/README.md +0 -12
- data/contrib/emacs/vagrant.el +0 -8
- data/contrib/vim/vagrantfile.vim +0 -9
- data/keys/README.md +0 -17
- data/keys/vagrant +0 -27
- data/keys/vagrant.pub +0 -1
- data/lib/vagrant.rb +0 -197
- data/lib/vagrant/action.rb +0 -63
- data/lib/vagrant/action/box/destroy.rb +0 -25
- data/lib/vagrant/action/box/download.rb +0 -84
- data/lib/vagrant/action/box/package.rb +0 -19
- data/lib/vagrant/action/box/unpackage.rb +0 -61
- data/lib/vagrant/action/box/verify.rb +0 -23
- data/lib/vagrant/action/builder.rb +0 -128
- data/lib/vagrant/action/builtin.rb +0 -171
- data/lib/vagrant/action/env/set.rb +0 -21
- data/lib/vagrant/action/environment.rb +0 -12
- data/lib/vagrant/action/general/check_virtualbox.rb +0 -28
- data/lib/vagrant/action/general/package.rb +0 -101
- data/lib/vagrant/action/general/validate.rb +0 -18
- data/lib/vagrant/action/runner.rb +0 -53
- data/lib/vagrant/action/vm/boot.rb +0 -53
- data/lib/vagrant/action/vm/check_accessible.rb +0 -23
- data/lib/vagrant/action/vm/check_box.rb +0 -33
- data/lib/vagrant/action/vm/check_guest_additions.rb +0 -38
- data/lib/vagrant/action/vm/check_port_collisions.rb +0 -89
- data/lib/vagrant/action/vm/clean_machine_folder.rb +0 -43
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +0 -18
- data/lib/vagrant/action/vm/clear_network_interfaces.rb +0 -31
- data/lib/vagrant/action/vm/clear_shared_folders.rb +0 -18
- data/lib/vagrant/action/vm/customize.rb +0 -36
- data/lib/vagrant/action/vm/default_name.rb +0 -22
- data/lib/vagrant/action/vm/destroy.rb +0 -19
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +0 -20
- data/lib/vagrant/action/vm/discard_state.rb +0 -22
- data/lib/vagrant/action/vm/export.rb +0 -57
- data/lib/vagrant/action/vm/forward_ports.rb +0 -92
- data/lib/vagrant/action/vm/halt.rb +0 -32
- data/lib/vagrant/action/vm/host_name.rb +0 -21
- data/lib/vagrant/action/vm/import.rb +0 -48
- data/lib/vagrant/action/vm/match_mac_address.rb +0 -21
- data/lib/vagrant/action/vm/network.rb +0 -403
- data/lib/vagrant/action/vm/nfs.rb +0 -196
- data/lib/vagrant/action/vm/package.rb +0 -23
- data/lib/vagrant/action/vm/package_vagrantfile.rb +0 -36
- data/lib/vagrant/action/vm/provision.rb +0 -61
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +0 -26
- data/lib/vagrant/action/vm/prune_nfs_exports.rb +0 -20
- data/lib/vagrant/action/vm/resume.rb +0 -20
- data/lib/vagrant/action/vm/sane_defaults.rb +0 -78
- data/lib/vagrant/action/vm/setup_package_files.rb +0 -54
- data/lib/vagrant/action/vm/share_folders.rb +0 -114
- data/lib/vagrant/action/vm/suspend.rb +0 -20
- data/lib/vagrant/action/warden.rb +0 -92
- data/lib/vagrant/box.rb +0 -44
- data/lib/vagrant/box_collection.rb +0 -58
- data/lib/vagrant/cli.rb +0 -76
- data/lib/vagrant/command.rb +0 -24
- data/lib/vagrant/command/base.rb +0 -167
- data/lib/vagrant/command/box.rb +0 -58
- data/lib/vagrant/command/box_add.rb +0 -37
- data/lib/vagrant/command/box_list.rb +0 -28
- data/lib/vagrant/command/box_remove.rb +0 -27
- data/lib/vagrant/command/box_repackage.rb +0 -27
- data/lib/vagrant/command/destroy.rb +0 -64
- data/lib/vagrant/command/gem.rb +0 -39
- data/lib/vagrant/command/halt.rb +0 -39
- data/lib/vagrant/command/init.rb +0 -40
- data/lib/vagrant/command/package.rb +0 -75
- data/lib/vagrant/command/provision.rb +0 -40
- data/lib/vagrant/command/reload.rb +0 -39
- data/lib/vagrant/command/resume.rb +0 -33
- data/lib/vagrant/command/ssh.rb +0 -90
- data/lib/vagrant/command/ssh_config.rb +0 -51
- data/lib/vagrant/command/start_mixins.rb +0 -26
- data/lib/vagrant/command/status.rb +0 -36
- data/lib/vagrant/command/suspend.rb +0 -33
- data/lib/vagrant/command/up.rb +0 -40
- data/lib/vagrant/communication.rb +0 -7
- data/lib/vagrant/communication/base.rb +0 -56
- data/lib/vagrant/communication/ssh.rb +0 -230
- data/lib/vagrant/config.rb +0 -49
- data/lib/vagrant/config/base.rb +0 -82
- data/lib/vagrant/config/container.rb +0 -37
- data/lib/vagrant/config/error_recorder.rb +0 -19
- data/lib/vagrant/config/loader.rb +0 -127
- data/lib/vagrant/config/nfs.rb +0 -8
- data/lib/vagrant/config/package.rb +0 -7
- data/lib/vagrant/config/ssh.rb +0 -27
- data/lib/vagrant/config/top.rb +0 -72
- data/lib/vagrant/config/vagrant.rb +0 -14
- data/lib/vagrant/config/vm.rb +0 -168
- data/lib/vagrant/config/vm/provisioner.rb +0 -52
- data/lib/vagrant/config/vm/sub_vm.rb +0 -17
- data/lib/vagrant/data_store.rb +0 -92
- data/lib/vagrant/downloaders.rb +0 -7
- data/lib/vagrant/downloaders/base.rb +0 -25
- data/lib/vagrant/downloaders/file.rb +0 -22
- data/lib/vagrant/downloaders/http.rb +0 -97
- data/lib/vagrant/driver.rb +0 -8
- data/lib/vagrant/driver/virtualbox.rb +0 -134
- data/lib/vagrant/driver/virtualbox_4_0.rb +0 -459
- data/lib/vagrant/driver/virtualbox_4_1.rb +0 -459
- data/lib/vagrant/driver/virtualbox_4_2.rb +0 -606
- data/lib/vagrant/driver/virtualbox_base.rb +0 -326
- data/lib/vagrant/environment.rb +0 -522
- data/lib/vagrant/errors.rb +0 -445
- data/lib/vagrant/guest.rb +0 -18
- data/lib/vagrant/guest/arch.rb +0 -56
- data/lib/vagrant/guest/base.rb +0 -99
- data/lib/vagrant/guest/debian.rb +0 -64
- data/lib/vagrant/guest/fedora.rb +0 -66
- data/lib/vagrant/guest/freebsd.rb +0 -86
- data/lib/vagrant/guest/gentoo.rb +0 -46
- data/lib/vagrant/guest/linux.rb +0 -118
- data/lib/vagrant/guest/linux/config.rb +0 -19
- data/lib/vagrant/guest/linux/error.rb +0 -9
- data/lib/vagrant/guest/openbsd.rb +0 -20
- data/lib/vagrant/guest/redhat.rb +0 -67
- data/lib/vagrant/guest/solaris.rb +0 -118
- data/lib/vagrant/guest/suse.rb +0 -17
- data/lib/vagrant/guest/ubuntu.rb +0 -23
- data/lib/vagrant/hosts.rb +0 -37
- data/lib/vagrant/hosts/arch.rb +0 -55
- data/lib/vagrant/hosts/base.rb +0 -66
- data/lib/vagrant/hosts/bsd.rb +0 -97
- data/lib/vagrant/hosts/fedora.rb +0 -47
- data/lib/vagrant/hosts/freebsd.rb +0 -41
- data/lib/vagrant/hosts/gentoo.rb +0 -20
- data/lib/vagrant/hosts/linux.rb +0 -94
- data/lib/vagrant/hosts/opensuse.rb +0 -30
- data/lib/vagrant/hosts/windows.rb +0 -16
- data/lib/vagrant/plugin.rb +0 -81
- data/lib/vagrant/provisioners.rb +0 -12
- data/lib/vagrant/provisioners/base.rb +0 -44
- data/lib/vagrant/provisioners/chef.rb +0 -168
- data/lib/vagrant/provisioners/chef_client.rb +0 -132
- data/lib/vagrant/provisioners/chef_solo.rb +0 -234
- data/lib/vagrant/provisioners/puppet.rb +0 -176
- data/lib/vagrant/provisioners/puppet_server.rb +0 -78
- data/lib/vagrant/provisioners/shell.rb +0 -103
- data/lib/vagrant/registry.rb +0 -52
- data/lib/vagrant/ssh.rb +0 -126
- data/lib/vagrant/test_helpers.rb +0 -154
- data/lib/vagrant/ui.rb +0 -168
- data/lib/vagrant/util.rb +0 -12
- data/lib/vagrant/util/ansi_escape_code_remover.rb +0 -34
- data/lib/vagrant/util/busy.rb +0 -59
- data/lib/vagrant/util/counter.rb +0 -24
- data/lib/vagrant/util/file_checksum.rb +0 -38
- data/lib/vagrant/util/file_mode.rb +0 -12
- data/lib/vagrant/util/hash_with_indifferent_access.rb +0 -63
- data/lib/vagrant/util/is_port_open.rb +0 -38
- data/lib/vagrant/util/line_ending_helpers.rb +0 -14
- data/lib/vagrant/util/network_ip.rb +0 -28
- data/lib/vagrant/util/platform.rb +0 -68
- data/lib/vagrant/util/retryable.rb +0 -25
- data/lib/vagrant/util/safe_exec.rb +0 -36
- data/lib/vagrant/util/safe_puts.rb +0 -31
- data/lib/vagrant/util/stacked_proc_runner.rb +0 -35
- data/lib/vagrant/util/subprocess.rb +0 -247
- data/lib/vagrant/util/template_renderer.rb +0 -83
- data/lib/vagrant/version.rb +0 -6
- data/lib/vagrant/vm.rb +0 -195
- data/tasks/acceptance.rake +0 -113
- data/tasks/bundler.rake +0 -3
- data/tasks/test.rake +0 -20
- data/templates/commands/init/Vagrantfile.erb +0 -99
- data/templates/commands/ssh_config/config.erb +0 -15
- data/templates/config/validation_failed.erb +0 -7
- data/templates/guests/arch/network_dhcp.erb +0 -7
- data/templates/guests/arch/network_static.erb +0 -7
- data/templates/guests/debian/network_dhcp.erb +0 -6
- data/templates/guests/debian/network_static.erb +0 -7
- data/templates/guests/fedora/network_dhcp.erb +0 -6
- data/templates/guests/fedora/network_static.erb +0 -13
- data/templates/guests/freebsd/network_dhcp.erb +0 -3
- data/templates/guests/freebsd/network_static.erb +0 -3
- data/templates/guests/gentoo/network_dhcp.erb +0 -4
- data/templates/guests/gentoo/network_static.erb +0 -4
- data/templates/guests/redhat/network_dhcp.erb +0 -6
- data/templates/guests/redhat/network_static.erb +0 -7
- data/templates/locales/en.yml +0 -759
- data/templates/nfs/exports.erb +0 -5
- data/templates/nfs/exports_freebsd.erb +0 -5
- data/templates/nfs/exports_linux.erb +0 -5
- data/templates/package_Vagrantfile.erb +0 -11
- data/templates/provisioners/chef_client/client.erb +0 -32
- data/templates/provisioners/chef_solo/solo.erb +0 -25
- data/test/acceptance/base.rb +0 -48
- data/test/acceptance/box_test.rb +0 -99
- data/test/acceptance/destroy_test.rb +0 -37
- data/test/acceptance/halt_test.rb +0 -72
- data/test/acceptance/init_test.rb +0 -33
- data/test/acceptance/networking/host_only_test.rb +0 -37
- data/test/acceptance/networking/port_forward_test.rb +0 -125
- data/test/acceptance/package_test.rb +0 -46
- data/test/acceptance/provisioning/basic_test.rb +0 -61
- data/test/acceptance/provisioning/chef_solo_test.rb +0 -37
- data/test/acceptance/provisioning/shell_test.rb +0 -53
- data/test/acceptance/resume_test.rb +0 -17
- data/test/acceptance/shared_folders_test.rb +0 -84
- data/test/acceptance/skeletons/chef_solo_basic/README.md +0 -3
- data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +0 -5
- data/test/acceptance/skeletons/chef_solo_json/README.md +0 -3
- data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +0 -6
- data/test/acceptance/skeletons/provisioner_multi/README.md +0 -3
- data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +0 -5
- data/test/acceptance/ssh_test.rb +0 -46
- data/test/acceptance/support/config.rb +0 -42
- data/test/acceptance/support/isolated_environment.rb +0 -117
- data/test/acceptance/support/matchers/have_color.rb +0 -9
- data/test/acceptance/support/matchers/match_output.rb +0 -14
- data/test/acceptance/support/matchers/succeed.rb +0 -14
- data/test/acceptance/support/network_tests.rb +0 -29
- data/test/acceptance/support/output.rb +0 -95
- data/test/acceptance/support/shared/base_context.rb +0 -72
- data/test/acceptance/support/shared/command_examples.rb +0 -33
- data/test/acceptance/support/virtualbox.rb +0 -36
- data/test/acceptance/suspend_test.rb +0 -56
- data/test/acceptance/up_basic_test.rb +0 -33
- data/test/acceptance/up_with_box_url.rb +0 -40
- data/test/acceptance/vagrant_test.rb +0 -47
- data/test/acceptance/version_test.rb +0 -15
- data/test/buildbot/README.md +0 -72
- data/test/buildbot/buildbot_config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +0 -24
- data/test/buildbot/buildbot_config/config/master.py +0 -24
- data/test/buildbot/buildbot_config/config/slave.py +0 -22
- data/test/buildbot/buildbot_config/master/__init__.py +0 -6
- data/test/buildbot/buildbot_config/master/builders.py +0 -78
- data/test/buildbot/buildbot_config/master/buildsteps.py +0 -100
- data/test/buildbot/buildbot_config/master/change_sources.py +0 -8
- data/test/buildbot/buildbot_config/master/schedulers.py +0 -32
- data/test/buildbot/buildbot_config/master/slaves.py +0 -60
- data/test/buildbot/buildbot_config/master/status.py +0 -52
- data/test/buildbot/master/Makefile.sample +0 -28
- data/test/buildbot/master/buildbot.tac +0 -36
- data/test/buildbot/master/master.cfg +0 -67
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +0 -545
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +0 -10
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +0 -356
- data/test/buildbot/master/public_html/static/css/prettify.css +0 -97
- data/test/buildbot/master/public_html/static/css/syntax.css +0 -60
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +0 -205
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +0 -80
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +0 -4
- data/test/buildbot/master/templates/authfail.html +0 -9
- data/test/buildbot/master/templates/build.html +0 -205
- data/test/buildbot/master/templates/builder.html +0 -118
- data/test/buildbot/master/templates/builders.html +0 -33
- data/test/buildbot/master/templates/buildslave.html +0 -72
- data/test/buildbot/master/templates/buildslaves.html +0 -70
- data/test/buildbot/master/templates/change.html +0 -15
- data/test/buildbot/master/templates/layouts/base.html +0 -58
- data/test/buildbot/master/templates/macros/box.html +0 -37
- data/test/buildbot/master/templates/macros/build_line.html +0 -50
- data/test/buildbot/master/templates/macros/change.html +0 -81
- data/test/buildbot/master/templates/macros/forms.html +0 -300
- data/test/buildbot/master/templates/root.html +0 -42
- data/test/buildbot/master/templates/waterfall.html +0 -53
- data/test/buildbot/requirements.txt +0 -4
- data/test/buildbot/scripts/deploy.sh +0 -38
- data/test/buildbot/scripts/setup.sh +0 -107
- data/test/buildbot/slave/buildbot.tac +0 -43
- data/test/buildbot/slave/info/admin +0 -1
- data/test/buildbot/slave/info/host +0 -1
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +0 -41
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/config/acceptance_boxes.yml +0 -7
- data/test/support/isolated_environment.rb +0 -46
- data/test/support/tempdir.rb +0 -34
- data/test/unit/base.rb +0 -21
- data/test/unit/support/isolated_environment.rb +0 -47
- data/test/unit/support/shared/base_context.rb +0 -30
- data/test/unit/vagrant/action/builder_test.rb +0 -156
- data/test/unit/vagrant/action/environment_test.rb +0 -16
- data/test/unit/vagrant/action/runner_test.rb +0 -65
- data/test/unit/vagrant/action/warden_test.rb +0 -92
- data/test/unit/vagrant/box_collection_test.rb +0 -56
- data/test/unit/vagrant/box_test.rb +0 -34
- data/test/unit/vagrant/command/base_test.rb +0 -150
- data/test/unit/vagrant/config/base_test.rb +0 -48
- data/test/unit/vagrant/config/loader_test.rb +0 -79
- data/test/unit/vagrant/config/ssh_test.rb +0 -17
- data/test/unit/vagrant/config/top_test.rb +0 -69
- data/test/unit/vagrant/config/vm_test.rb +0 -71
- data/test/unit/vagrant/config_test.rb +0 -27
- data/test/unit/vagrant/data_store_test.rb +0 -79
- data/test/unit/vagrant/downloaders/base_test.rb +0 -18
- data/test/unit/vagrant/downloaders/file_test.rb +0 -75
- data/test/unit/vagrant/downloaders/http_test.rb +0 -19
- data/test/unit/vagrant/environment_test.rb +0 -220
- data/test/unit/vagrant/hosts_test.rb +0 -36
- data/test/unit/vagrant/registry_test.rb +0 -74
- data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +0 -16
- data/test/unit/vagrant/util/file_checksum_test.rb +0 -23
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +0 -38
- data/test/unit/vagrant/util/is_port_open_test.rb +0 -53
- data/test/unit/vagrant/util/line_endings_helper_test.rb +0 -16
- data/test/unit/vagrant/util/network_ip_test.rb +0 -17
- data/test/unit/vagrant/util/retryable_test.rb +0 -106
- data/test/unit/vagrant_test.rb +0 -27
- data/test/unit_legacy/locales/en.yml +0 -8
- data/test/unit_legacy/test_helper.rb +0 -32
- data/test/unit_legacy/vagrant/action/box/destroy_test.rb +0 -18
- data/test/unit_legacy/vagrant/action/box/download_test.rb +0 -125
- data/test/unit_legacy/vagrant/action/box/package_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +0 -84
- data/test/unit_legacy/vagrant/action/box/verify_test.rb +0 -30
- data/test/unit_legacy/vagrant/action/env/set_test.rb +0 -24
- data/test/unit_legacy/vagrant/action/general/package_test.rb +0 -268
- data/test/unit_legacy/vagrant/action/general/validate_test.rb +0 -31
- data/test/unit_legacy/vagrant/action/vm/boot_test.rb +0 -66
- data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +0 -61
- data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +0 -61
- data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +0 -9
- data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +0 -84
- data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +0 -52
- data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +0 -22
- data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +0 -40
- data/test/unit_legacy/vagrant/action/vm/customize_test.rb +0 -37
- data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +0 -49
- data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +0 -45
- data/test/unit_legacy/vagrant/action/vm/export_test.rb +0 -107
- data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +0 -77
- data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +0 -197
- data/test/unit_legacy/vagrant/action/vm/halt_test.rb +0 -79
- data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +0 -36
- data/test/unit_legacy/vagrant/action/vm/import_test.rb +0 -66
- data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +0 -40
- data/test/unit_legacy/vagrant/action/vm/modify_test.rb +0 -38
- data/test/unit_legacy/vagrant/action/vm/network_test.rb +0 -286
- data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +0 -26
- data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +0 -260
- data/test/unit_legacy/vagrant/action/vm/package_test.rb +0 -25
- data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +0 -46
- data/test/unit_legacy/vagrant/action/vm/provision_test.rb +0 -65
- data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +0 -56
- data/test/unit_legacy/vagrant/action/vm/resume_test.rb +0 -35
- data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +0 -144
- data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +0 -35
- data/test/unit_legacy/vagrant/action_test.rb +0 -89
- data/test/unit_legacy/vagrant/box_collection_test.rb +0 -45
- data/test/unit_legacy/vagrant/box_test.rb +0 -74
- data/test/unit_legacy/vagrant/cli_test.rb +0 -35
- data/test/unit_legacy/vagrant/command/base_test.rb +0 -23
- data/test/unit_legacy/vagrant/command/group_base_test.rb +0 -15
- data/test/unit_legacy/vagrant/command/helpers_test.rb +0 -88
- data/test/unit_legacy/vagrant/command/init_test.rb +0 -10
- data/test/unit_legacy/vagrant/command/package_test.rb +0 -27
- data/test/unit_legacy/vagrant/config/base_test.rb +0 -52
- data/test/unit_legacy/vagrant/config/error_recorder_test.rb +0 -18
- data/test/unit_legacy/vagrant/config/ssh_test.rb +0 -12
- data/test/unit_legacy/vagrant/config/vagrant_test.rb +0 -35
- data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +0 -92
- data/test/unit_legacy/vagrant/config/vm_test.rb +0 -47
- data/test/unit_legacy/vagrant/config_test.rb +0 -148
- data/test/unit_legacy/vagrant/downloaders/http_test.rb +0 -93
- data/test/unit_legacy/vagrant/environment_test.rb +0 -539
- data/test/unit_legacy/vagrant/errors_test.rb +0 -42
- data/test/unit_legacy/vagrant/hosts/base_test.rb +0 -46
- data/test/unit_legacy/vagrant/hosts/bsd_test.rb +0 -53
- data/test/unit_legacy/vagrant/hosts/linux_test.rb +0 -54
- data/test/unit_legacy/vagrant/plugin_test.rb +0 -9
- data/test/unit_legacy/vagrant/provisioners/base_test.rb +0 -63
- data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +0 -190
- data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +0 -115
- data/test/unit_legacy/vagrant/provisioners/chef_test.rb +0 -209
- data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +0 -68
- data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +0 -182
- data/test/unit_legacy/vagrant/provisioners/shell_test.rb +0 -79
- data/test/unit_legacy/vagrant/ssh/session_test.rb +0 -40
- data/test/unit_legacy/vagrant/ssh_test.rb +0 -304
- data/test/unit_legacy/vagrant/systems/base_test.rb +0 -18
- data/test/unit_legacy/vagrant/systems/linux_test.rb +0 -104
- data/test/unit_legacy/vagrant/util/busy_test.rb +0 -106
- data/test/unit_legacy/vagrant/util/counter_test.rb +0 -29
- data/test/unit_legacy/vagrant/util/platform_test.rb +0 -18
- data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +0 -43
- data/test/unit_legacy/vagrant/util/template_renderer_test.rb +0 -145
- data/test/unit_legacy/vagrant/vm_test.rb +0 -300
@@ -1,38 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
#
|
3
|
-
# This shell script deploys the buildmaster by downloading an
|
4
|
-
# up-to-date tar.gz from GitHub and setting up the proper environment.
|
5
|
-
|
6
|
-
#----------------------------------------------------------------------
|
7
|
-
# Update the source
|
8
|
-
#----------------------------------------------------------------------
|
9
|
-
# Download the Vagrant source, extract it
|
10
|
-
cd /tmp
|
11
|
-
rm -rf vagrant
|
12
|
-
rm -rf mitchellh-vagrant-*
|
13
|
-
wget https://github.com/mitchellh/vagrant/tarball/master -O vagrant.tar.gz
|
14
|
-
tar xvzf vagrant.tar.gz
|
15
|
-
mv mitchellh-vagrant-* vagrant
|
16
|
-
|
17
|
-
# Move the code into place
|
18
|
-
cp -R vagrant/test/buildbot/* /srv/buildmaster/
|
19
|
-
|
20
|
-
# Setup the virtualenv
|
21
|
-
cd /srv/buildmaster
|
22
|
-
virtualenv --no-site-packages env
|
23
|
-
|
24
|
-
# Activate the environment
|
25
|
-
. env/bin/activate
|
26
|
-
|
27
|
-
# Install dependencies
|
28
|
-
pip install -r requirements.txt
|
29
|
-
|
30
|
-
#----------------------------------------------------------------------
|
31
|
-
# Update the buildmaster
|
32
|
-
#----------------------------------------------------------------------
|
33
|
-
# Setup environmental variables that are required
|
34
|
-
export BUILDBOT_CONFIG=/etc/buildmaster/master.cfg
|
35
|
-
export PYTHONPATH=/srv/buildmaster
|
36
|
-
|
37
|
-
# Restart the buildmaster
|
38
|
-
buildbot restart master/
|
@@ -1,107 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
#
|
3
|
-
# This shell script installs and prepares all the software necessary
|
4
|
-
# to run the build master. This script is expected to be run as root.
|
5
|
-
# This script is made to be run only on Ubuntu 10.04 LTS at the moment.
|
6
|
-
|
7
|
-
# Update the source list
|
8
|
-
apt-get update
|
9
|
-
|
10
|
-
# Install the basic sysadmin stuff
|
11
|
-
apt-get install -y htop
|
12
|
-
|
13
|
-
# Fix the mountall bug in the AMI
|
14
|
-
sed -i -e 's/nobootwait,//' /etc/fstab
|
15
|
-
|
16
|
-
#----------------------------------------------------------------------
|
17
|
-
# Python Setup
|
18
|
-
#----------------------------------------------------------------------
|
19
|
-
# Install Python and pip
|
20
|
-
apt-get install -y python python-dev python-setuptools
|
21
|
-
easy_install pip
|
22
|
-
|
23
|
-
# Install virtualenv
|
24
|
-
pip install virtualenv
|
25
|
-
|
26
|
-
#----------------------------------------------------------------------
|
27
|
-
# Deploy Setup
|
28
|
-
#----------------------------------------------------------------------
|
29
|
-
# Install Git, which is used for all the deploys of the build master
|
30
|
-
apt-get install -y git-core
|
31
|
-
|
32
|
-
# Create the user/group for the buildmaster
|
33
|
-
groupadd buildmaster
|
34
|
-
useradd -d /home/buildmaster -g buildmaster -s /bin/bash buildmaster
|
35
|
-
mkdir /home/buildmaster
|
36
|
-
chown -R buildmaster:buildmaster /home/buildmaster
|
37
|
-
|
38
|
-
# Make the folder which will contain the buildmaster code
|
39
|
-
mkdir -p /srv/buildmaster
|
40
|
-
chown buildmaster:buildmaster /srv/buildmaster
|
41
|
-
|
42
|
-
# Make the folder which will contain the configuration for the
|
43
|
-
# buildmaster
|
44
|
-
mkdir -p /etc/buildmaster
|
45
|
-
chown buildmaster:buildmaster /etc/buildmaster
|
46
|
-
|
47
|
-
#----------------------------------------------------------------------
|
48
|
-
# Nginx Setup
|
49
|
-
#----------------------------------------------------------------------
|
50
|
-
# Install Nginx
|
51
|
-
apt-get install -y nginx
|
52
|
-
|
53
|
-
# Setup the basic directories
|
54
|
-
mkdir -p /etc/nginx/conf.d
|
55
|
-
mkdir -p /etc/nginx/sites-available
|
56
|
-
mkdir -p /etc/nginx/sites-enabled
|
57
|
-
|
58
|
-
# Setup the configuration
|
59
|
-
cat <<EOF > /etc/nginx/nginx.conf
|
60
|
-
user www-data;
|
61
|
-
worker_processes 1;
|
62
|
-
|
63
|
-
# Raise the limit on open file descriptors
|
64
|
-
worker_rlimit_nofile 30000;
|
65
|
-
|
66
|
-
error_log /var/log/nginx/error.log;
|
67
|
-
pid /var/run/nginx.pid;
|
68
|
-
|
69
|
-
events {
|
70
|
-
worker_connections 1024;
|
71
|
-
use epoll;
|
72
|
-
}
|
73
|
-
|
74
|
-
http {
|
75
|
-
include /etc/nginx/mime.types;
|
76
|
-
default_type application/octet-stream;
|
77
|
-
|
78
|
-
access_log /var/log/nginx/access.log;
|
79
|
-
|
80
|
-
sendfile on;
|
81
|
-
tcp_nopush on;
|
82
|
-
tcp_nodelay on;
|
83
|
-
|
84
|
-
keepalive_timeout 65;
|
85
|
-
|
86
|
-
include /etc/nginx/conf.d/*.conf;
|
87
|
-
include /etc/nginx/sites-enabled/*;
|
88
|
-
}
|
89
|
-
EOF
|
90
|
-
|
91
|
-
# Setup the buildbot site
|
92
|
-
cat <<EOF > /etc/nginx/sites-available/buildmaster.conf
|
93
|
-
server {
|
94
|
-
listen 80;
|
95
|
-
|
96
|
-
location / {
|
97
|
-
proxy_pass http://localhost:8000;
|
98
|
-
}
|
99
|
-
}
|
100
|
-
EOF
|
101
|
-
|
102
|
-
# Activate the buildbot site, remove the default
|
103
|
-
rm /etc/nginx/sites-enabled/default
|
104
|
-
ln -f -s /etc/nginx/sites-available/buildmaster.conf /etc/nginx/sites-enabled/buildmaster.conf
|
105
|
-
|
106
|
-
# Restart nginx
|
107
|
-
/etc/init.d/nginx restart
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
|
3
|
-
from twisted.application import service
|
4
|
-
from buildslave.bot import BuildSlave
|
5
|
-
|
6
|
-
from buildbot_config.config.slave import options
|
7
|
-
|
8
|
-
basedir = r'.'
|
9
|
-
rotateLength = 10000000
|
10
|
-
maxRotatedFiles = 10
|
11
|
-
|
12
|
-
# if this is a relocatable tac file, get the directory containing the TAC
|
13
|
-
if basedir == '.':
|
14
|
-
import os.path
|
15
|
-
basedir = os.path.abspath(os.path.dirname(__file__))
|
16
|
-
|
17
|
-
# note: this line is matched against to check that this is a buildslave
|
18
|
-
# directory; do not edit it.
|
19
|
-
application = service.Application('buildslave')
|
20
|
-
|
21
|
-
try:
|
22
|
-
from twisted.python.logfile import LogFile
|
23
|
-
from twisted.python.log import ILogObserver, FileLogObserver
|
24
|
-
logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
|
25
|
-
maxRotatedFiles=maxRotatedFiles)
|
26
|
-
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
|
27
|
-
except ImportError:
|
28
|
-
# probably not yet twisted 8.2.0 and beyond, can't set log yet
|
29
|
-
pass
|
30
|
-
|
31
|
-
buildmaster_host = options.master_host
|
32
|
-
port = options.master_port
|
33
|
-
slavename = options.name
|
34
|
-
passwd = options.password
|
35
|
-
keepalive = 600
|
36
|
-
usepty = 0
|
37
|
-
umask = None
|
38
|
-
maxdelay = 300
|
39
|
-
|
40
|
-
s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
|
41
|
-
keepalive, usepty, umask=umask, maxdelay=maxdelay)
|
42
|
-
s.setServiceParent(application)
|
43
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
Buildslave Admin <foo@bar.com>
|
@@ -1 +0,0 @@
|
|
1
|
-
Please put a description of this build host here
|
File without changes
|
File without changes
|
@@ -1,41 +0,0 @@
|
|
1
|
-
from buildbot.buildslave import BuildSlave
|
2
|
-
|
3
|
-
from buildbot_config.master.slaves import (
|
4
|
-
BuildSlavesFromSlaveConfigs,
|
5
|
-
SlaveConfig,
|
6
|
-
SlaveListFromConfig)
|
7
|
-
|
8
|
-
class TestSlaveListFromConfig(object):
|
9
|
-
Klass = SlaveListFromConfig
|
10
|
-
|
11
|
-
def test_parse_single(self):
|
12
|
-
"""
|
13
|
-
Tests that the config parser can parse a single
|
14
|
-
slave.
|
15
|
-
"""
|
16
|
-
instance = self.Klass("foo:bar")
|
17
|
-
assert 1 == len(instance)
|
18
|
-
assert SlaveConfig("foo", "bar") == instance[0]
|
19
|
-
|
20
|
-
def test_parse_multiple(self):
|
21
|
-
"""
|
22
|
-
Tests that the config parser can parse multiple
|
23
|
-
slaves.
|
24
|
-
"""
|
25
|
-
instance = self.Klass("foo:bar,bar:baz")
|
26
|
-
expected = [SlaveConfig("foo", "bar"), SlaveConfig("bar", "baz")]
|
27
|
-
|
28
|
-
assert 2 == len(instance)
|
29
|
-
assert expected == instance
|
30
|
-
|
31
|
-
class TestBuildSlavesFromSlaveConfig(object):
|
32
|
-
Klass = BuildSlavesFromSlaveConfigs
|
33
|
-
|
34
|
-
def test_returns_build_slaves(self):
|
35
|
-
"""
|
36
|
-
Tests that build slaves are properly returned for each
|
37
|
-
slave configuration.
|
38
|
-
"""
|
39
|
-
instance = self.Klass([SlaveConfig("foo", "bar")])
|
40
|
-
assert 1 == len(instance)
|
41
|
-
assert isinstance(instance[0], BuildSlave)
|
Binary file
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# This is the list of required boxes for acceptance tests, and
|
2
|
-
# their locations. The locations are used to download the boxes
|
3
|
-
# on the fly, if necessary. Additionally, a SHA1 checksum is
|
4
|
-
# given to determine if the box needs to be updated.
|
5
|
-
- name: default
|
6
|
-
url: http://files.vagrantup.com/test/boxes/default.box
|
7
|
-
checksum: 1b0a7eb6e152c5b43f45485654ff4965a7f9f604
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "pathname"
|
3
|
-
|
4
|
-
require "log4r"
|
5
|
-
|
6
|
-
require "support/tempdir"
|
7
|
-
|
8
|
-
# This class manages an isolated environment for Vagrant to
|
9
|
-
# run in. It creates a temporary directory to act as the
|
10
|
-
# working directory as well as sets a custom home directory.
|
11
|
-
#
|
12
|
-
# This class also provides various helpers to create Vagrantfiles,
|
13
|
-
# boxes, etc.
|
14
|
-
class IsolatedEnvironment
|
15
|
-
attr_reader :homedir
|
16
|
-
attr_reader :workdir
|
17
|
-
|
18
|
-
# Initializes an isolated environment. You can pass in some
|
19
|
-
# options here to configure runing custom applications in place
|
20
|
-
# of others as well as specifying environmental variables.
|
21
|
-
#
|
22
|
-
# @param [Hash] apps A mapping of application name (such as "vagrant")
|
23
|
-
# to an alternate full path to the binary to run.
|
24
|
-
# @param [Hash] env Additional environmental variables to inject
|
25
|
-
# into the execution environments.
|
26
|
-
def initialize
|
27
|
-
@logger = Log4r::Logger.new("test::isolated_environment")
|
28
|
-
|
29
|
-
# Create a temporary directory for our work
|
30
|
-
@tempdir = Tempdir.new("vagrant")
|
31
|
-
@logger.info("Initialize isolated environment: #{@tempdir.path}")
|
32
|
-
|
33
|
-
# Setup the home and working directories
|
34
|
-
@homedir = Pathname.new(File.join(@tempdir.path, "home"))
|
35
|
-
@workdir = Pathname.new(File.join(@tempdir.path, "work"))
|
36
|
-
|
37
|
-
@homedir.mkdir
|
38
|
-
@workdir.mkdir
|
39
|
-
end
|
40
|
-
|
41
|
-
# This closes the environment by cleaning it up.
|
42
|
-
def close
|
43
|
-
@logger.info("Removing isolated environment: #{@tempdir.path}")
|
44
|
-
FileUtils.rm_rf(@tempdir.path)
|
45
|
-
end
|
46
|
-
end
|
data/test/support/tempdir.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'tempfile'
|
3
|
-
|
4
|
-
# This class provides an easy way of creating a temporary
|
5
|
-
# directory and having it removed when the application exits.
|
6
|
-
#
|
7
|
-
# TODO: This class doesn't currently delete the temporary
|
8
|
-
# directory on exit.
|
9
|
-
class Tempdir
|
10
|
-
attr_reader :path
|
11
|
-
|
12
|
-
def initialize(basename="vagrant")
|
13
|
-
@path = nil
|
14
|
-
|
15
|
-
# Loop and attempt to create a temporary directory until
|
16
|
-
# it succeeds.
|
17
|
-
while @path.nil?
|
18
|
-
file = Tempfile.new(basename)
|
19
|
-
@path = file.path
|
20
|
-
file.unlink
|
21
|
-
|
22
|
-
begin
|
23
|
-
Dir.mkdir(@path)
|
24
|
-
rescue
|
25
|
-
@path = nil
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
# This deletes the temporary directory.
|
31
|
-
def unlink
|
32
|
-
FileUtils.rm_rf(@path)
|
33
|
-
end
|
34
|
-
end
|
data/test/unit/base.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "rspec/autorun"
|
3
|
-
|
4
|
-
# Require Vagrant itself so we can reference the proper
|
5
|
-
# classes to test.
|
6
|
-
require "vagrant"
|
7
|
-
|
8
|
-
# Add the test directory to the load path
|
9
|
-
$:.unshift File.expand_path("../../", __FILE__)
|
10
|
-
|
11
|
-
# Load in helpers
|
12
|
-
require "unit/support/shared/base_context"
|
13
|
-
|
14
|
-
# Do not buffer output
|
15
|
-
$stdout.sync = true
|
16
|
-
$stderr.sync = true
|
17
|
-
|
18
|
-
# Configure RSpec
|
19
|
-
RSpec.configure do |c|
|
20
|
-
c.expect_with :rspec, :stdlib
|
21
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "pathname"
|
3
|
-
|
4
|
-
require "log4r"
|
5
|
-
|
6
|
-
require "support/isolated_environment"
|
7
|
-
|
8
|
-
module Unit
|
9
|
-
class IsolatedEnvironment < ::IsolatedEnvironment
|
10
|
-
def create_vagrant_env(options=nil)
|
11
|
-
options = {
|
12
|
-
:cwd => @workdir,
|
13
|
-
:home_path => @homedir
|
14
|
-
}.merge(options || {})
|
15
|
-
|
16
|
-
Vagrant::Environment.new(options)
|
17
|
-
end
|
18
|
-
|
19
|
-
# This creates a file in the isolated environment. By default this file
|
20
|
-
# will be created in the working directory of the isolated environment.
|
21
|
-
def file(name, contents)
|
22
|
-
@workdir.join(name).open("w+") do |f|
|
23
|
-
f.write(contents)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def vagrantfile(contents, root=nil)
|
28
|
-
root ||= @workdir
|
29
|
-
root.join("Vagrantfile").open("w+") do |f|
|
30
|
-
f.write(contents)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def box(name, vagrantfile_contents="")
|
35
|
-
box_dir = boxes_dir.join(name)
|
36
|
-
box_dir.mkpath
|
37
|
-
vagrantfile(vagrantfile_contents, box_dir)
|
38
|
-
box_dir
|
39
|
-
end
|
40
|
-
|
41
|
-
def boxes_dir
|
42
|
-
dir = @homedir.join("boxes")
|
43
|
-
dir.mkpath
|
44
|
-
dir
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require "tempfile"
|
2
|
-
|
3
|
-
require "unit/support/isolated_environment"
|
4
|
-
|
5
|
-
shared_context "unit" do
|
6
|
-
# This creates an isolated environment so that Vagrant doesn't
|
7
|
-
# muck around with your real system during unit tests.
|
8
|
-
#
|
9
|
-
# The returned isolated environment has a variety of helper
|
10
|
-
# methods on it to easily create files, Vagrantfiles, boxes,
|
11
|
-
# etc.
|
12
|
-
def isolated_environment
|
13
|
-
env = Unit::IsolatedEnvironment.new
|
14
|
-
yield env if block_given?
|
15
|
-
env
|
16
|
-
end
|
17
|
-
|
18
|
-
# This helper creates a temporary file and returns a Pathname
|
19
|
-
# object pointed to it.
|
20
|
-
def temporary_file(contents=nil)
|
21
|
-
f = Tempfile.new("vagrant-unit")
|
22
|
-
|
23
|
-
if contents
|
24
|
-
f.write(contents)
|
25
|
-
f.flush
|
26
|
-
end
|
27
|
-
|
28
|
-
return Pathname.new(f.path)
|
29
|
-
end
|
30
|
-
end
|
@@ -1,156 +0,0 @@
|
|
1
|
-
require File.expand_path("../../../base", __FILE__)
|
2
|
-
|
3
|
-
describe Vagrant::Action::Builder do
|
4
|
-
let(:data) { { :data => [] } }
|
5
|
-
let(:instance) { described_class.new }
|
6
|
-
|
7
|
-
# This returns a proc that can be used with the builder
|
8
|
-
# that simply appends data to an array in the env.
|
9
|
-
def appender_proc(data)
|
10
|
-
Proc.new { |env| env[:data] << data }
|
11
|
-
end
|
12
|
-
|
13
|
-
context "basic `use`" do
|
14
|
-
it "should add items to the stack and make them callable" do
|
15
|
-
data = {}
|
16
|
-
proc = Proc.new { |env| env[:data] = true }
|
17
|
-
|
18
|
-
instance.use proc
|
19
|
-
instance.call(data)
|
20
|
-
|
21
|
-
data[:data].should == true
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should be able to add multiple items" do
|
25
|
-
data = {}
|
26
|
-
proc1 = Proc.new { |env| env[:one] = true }
|
27
|
-
proc2 = Proc.new { |env| env[:two] = true }
|
28
|
-
|
29
|
-
instance.use proc1
|
30
|
-
instance.use proc2
|
31
|
-
instance.call(data)
|
32
|
-
|
33
|
-
data[:one].should == true
|
34
|
-
data[:two].should == true
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should be able to add another builder" do
|
38
|
-
data = {}
|
39
|
-
proc1 = Proc.new { |env| env[:one] = true }
|
40
|
-
|
41
|
-
# Build the first builder
|
42
|
-
one = described_class.new
|
43
|
-
one.use proc1
|
44
|
-
|
45
|
-
# Add it to this builder
|
46
|
-
two = described_class.new
|
47
|
-
two.use one
|
48
|
-
|
49
|
-
# Call the 2nd and verify results
|
50
|
-
two.call(data)
|
51
|
-
data[:one].should == true
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should be able to set additional variables when using" do
|
55
|
-
data = { }
|
56
|
-
proc1 = Proc.new { |env| env[:data] += 1 }
|
57
|
-
|
58
|
-
# Build the first builder
|
59
|
-
one = described_class.new
|
60
|
-
one.use proc1, :data => 5
|
61
|
-
one.call(data)
|
62
|
-
|
63
|
-
data[:data].should == 6
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
context "inserting" do
|
68
|
-
it "can insert at an index" do
|
69
|
-
instance.use appender_proc(1)
|
70
|
-
instance.insert(0, appender_proc(2))
|
71
|
-
instance.call(data)
|
72
|
-
|
73
|
-
data[:data].should == [2, 1]
|
74
|
-
end
|
75
|
-
|
76
|
-
it "can insert next to a previous object" do
|
77
|
-
proc2 = appender_proc(2)
|
78
|
-
instance.use appender_proc(1)
|
79
|
-
instance.use proc2
|
80
|
-
instance.insert(proc2, appender_proc(3))
|
81
|
-
instance.call(data)
|
82
|
-
|
83
|
-
data[:data].should == [1, 3, 2]
|
84
|
-
end
|
85
|
-
|
86
|
-
it "can insert before" do
|
87
|
-
instance.use appender_proc(1)
|
88
|
-
instance.insert_before 0, appender_proc(2)
|
89
|
-
instance.call(data)
|
90
|
-
|
91
|
-
data[:data].should == [2, 1]
|
92
|
-
end
|
93
|
-
|
94
|
-
it "can insert after" do
|
95
|
-
instance.use appender_proc(1)
|
96
|
-
instance.use appender_proc(3)
|
97
|
-
instance.insert_after 0, appender_proc(2)
|
98
|
-
instance.call(data)
|
99
|
-
|
100
|
-
data[:data].should == [1, 2, 3]
|
101
|
-
end
|
102
|
-
|
103
|
-
it "raises an exception if an invalid object given" do
|
104
|
-
expect { instance.insert_after "object", appender_proc(1) }.
|
105
|
-
to raise_error(RuntimeError)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
context "replace" do
|
110
|
-
it "can replace an object" do
|
111
|
-
proc1 = appender_proc(1)
|
112
|
-
proc2 = appender_proc(2)
|
113
|
-
|
114
|
-
instance.use proc1
|
115
|
-
instance.replace proc1, proc2
|
116
|
-
instance.call(data)
|
117
|
-
|
118
|
-
data[:data].should == [2]
|
119
|
-
end
|
120
|
-
|
121
|
-
it "can replace by index" do
|
122
|
-
proc1 = appender_proc(1)
|
123
|
-
proc2 = appender_proc(2)
|
124
|
-
|
125
|
-
instance.use proc1
|
126
|
-
instance.replace 0, proc2
|
127
|
-
instance.call(data)
|
128
|
-
|
129
|
-
data[:data].should == [2]
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
context "deleting" do
|
134
|
-
it "can delete by object" do
|
135
|
-
proc1 = appender_proc(1)
|
136
|
-
|
137
|
-
instance.use proc1
|
138
|
-
instance.use appender_proc(2)
|
139
|
-
instance.delete proc1
|
140
|
-
instance.call(data)
|
141
|
-
|
142
|
-
data[:data].should == [2]
|
143
|
-
end
|
144
|
-
|
145
|
-
it "can delete by index" do
|
146
|
-
proc1 = appender_proc(1)
|
147
|
-
|
148
|
-
instance.use proc1
|
149
|
-
instance.use appender_proc(2)
|
150
|
-
instance.delete 0
|
151
|
-
instance.call(data)
|
152
|
-
|
153
|
-
data[:data].should == [2]
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|