[SCM] vim-addon-manager packaging branch, master, updated. v0.4.4-52-geef7258
Antonio Terceiro
terceiro at debian.org
Tue Jan 31 23:33:15 UTC 2012
The following commit has been merged in the master branch:
commit 36ef7a56b97c8a3cd5b69c442a553fc656dc360d
Author: Antonio Terceiro <terceiro at debian.org>
Date: Sun Jan 22 10:40:42 2012 -0200
Basic integration tests
diff --git a/features/install.feature b/features/install.feature
new file mode 100644
index 0000000..a0b9178
--- /dev/null
+++ b/features/install.feature
@@ -0,0 +1,5 @@
+Feature: installing addons
+
+ Scenario: installing foo
+ When I run `vim-addons install foo`
+ Then foo should be installed
diff --git a/features/remove.feature b/features/remove.feature
new file mode 100644
index 0000000..d2303ac
--- /dev/null
+++ b/features/remove.feature
@@ -0,0 +1,6 @@
+Feature: removing addons
+
+ Scenario: removing foo
+ Given foo is installed
+ When I run `vim-addons remove foo`
+ Then foo should not be installed anymore
diff --git a/features/step_definitions/steps.rb b/features/step_definitions/steps.rb
new file mode 100644
index 0000000..1247ac2
--- /dev/null
+++ b/features/step_definitions/steps.rb
@@ -0,0 +1,34 @@
+require 'rbconfig'
+require 'tmpdir'
+ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
+sources_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
+vim_addons = File.join(sources_root, 'bin', 'vim-addons')
+libdir = File.join(sources_root, 'lib')
+registry = File.join(sources_root , 'spec/data/registry')
+source = File.join(sources_root, 'spec/data/addons')
+
+Before do
+ @tmpdir = Dir.mktmpdir
+end
+
+After do
+ FileUtils.rm_rf(@tmpdir)
+end
+
+When /^I run `vim\-addons (.*)`$/ do |args|
+ command = [ruby, "-I#{libdir}", vim_addons, '--silent', '--registry-dir', registry, '--source-dir', source, '--target-dir', @tmpdir]
+ args.split.each { |a| command << a }
+ system *command
+end
+
+Then /^foo should be installed$/ do
+ Dir.glob(File.join(@tmpdir, '*/foo.vim')).should_not be_empty
+end
+
+Given /^(.*) is installed$/ do |addon|
+ Given "I run `vim-addons install #{addon}`"
+end
+
+Then /^(.*) should not be installed anymore$/ do |addon|
+ Dir.glob(File.join(@tmpdir, '*/foo.vim')).should be_empty
+end
--
vim-addon-manager packaging
More information about the pkg-vim-maintainers
mailing list