vimpack 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.autotest +13 -0
- data/.gitignore +6 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/Gemfile +2 -0
- data/LICENSE +21 -0
- data/README.md +47 -0
- data/Rakefile +5 -0
- data/autotest/discover.rb +2 -0
- data/bin/vimpack +103 -0
- data/cucumber.yml +13 -0
- data/features/commands/environments.feature +26 -0
- data/features/commands/git.feature +77 -0
- data/features/commands/info.feature +28 -0
- data/features/commands/init.feature +47 -0
- data/features/commands/install.feature +50 -0
- data/features/commands/list.feature +18 -0
- data/features/commands/search.feature +137 -0
- data/features/commands/uninstall.feature +46 -0
- data/features/step_definitions/environment_steps.rb +3 -0
- data/features/step_definitions/file_utils_steps.rb +36 -0
- data/features/step_definitions/initialize_steps.rb +14 -0
- data/features/step_definitions/output_steps.rb +12 -0
- data/features/step_definitions/vimpack_git_steps.rb +91 -0
- data/features/support/env.rb +11 -0
- data/features/support/executable_paths.rb +15 -0
- data/lib/vimpack/commands/command.rb +46 -0
- data/lib/vimpack/commands/git.rb +32 -0
- data/lib/vimpack/commands/info.rb +26 -0
- data/lib/vimpack/commands/init.rb +23 -0
- data/lib/vimpack/commands/install.rb +35 -0
- data/lib/vimpack/commands/list.rb +14 -0
- data/lib/vimpack/commands/search.rb +37 -0
- data/lib/vimpack/commands/uninstall.rb +27 -0
- data/lib/vimpack/commands.rb +8 -0
- data/lib/vimpack/models/apibase.rb +7 -0
- data/lib/vimpack/models/base.rb +29 -0
- data/lib/vimpack/models/repo.rb +117 -0
- data/lib/vimpack/models/script.rb +110 -0
- data/lib/vimpack/models.rb +8 -0
- data/lib/vimpack/utils/api.rb +39 -0
- data/lib/vimpack/utils/file.rb +66 -0
- data/lib/vimpack/utils/file_path.rb +25 -0
- data/lib/vimpack/utils/git.rb +103 -0
- data/lib/vimpack/utils/github.rb +41 -0
- data/lib/vimpack/utils/io.rb +26 -0
- data/lib/vimpack/utils/process.rb +61 -0
- data/lib/vimpack/utils/vimscripts.rb +64 -0
- data/lib/vimpack/version.rb +4 -0
- data/lib/vimpack.rb +46 -0
- data/simplecov_setup.rb +5 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/vimpack/models/repo_spec.rb +150 -0
- data/spec/vimpack/models/script_spec.rb +230 -0
- data/spec/vimpack/utils/github_spec.rb +39 -0
- data/spec/vimpack/utils/vimscripts_spec.rb +38 -0
- data/tasks/cucumber.rake +8 -0
- data/tasks/default.rake +2 -0
- data/tasks/rspec.rake +5 -0
- data/templates/vimrc.erb +6 -0
- data/vimpack.gemspec +42 -0
- metadata +333 -0
data/.autotest
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
begin
|
2
|
+
require "autotest/growl"
|
3
|
+
rescue LoadError
|
4
|
+
puts 'Not going to growl'
|
5
|
+
end
|
6
|
+
Autotest.add_hook :initialize do |at|
|
7
|
+
at.add_exception %r%^\./\.autotest%
|
8
|
+
at.add_exception %r%^\./.git.%
|
9
|
+
at.add_exception %r%^\./tmp%
|
10
|
+
at.add_exception %r%^\./log%
|
11
|
+
at.add_exception %r%^\./rerun\.txt%
|
12
|
+
at.add_exception %r%^\./coverage%
|
13
|
+
end
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.2@vimpack_dev
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2011 Bram Swenson
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# vimpack
|
2
|
+
|
3
|
+
vim package manager
|
4
|
+
|
5
|
+
### setup vimpack
|
6
|
+
|
7
|
+
# for now we install from the repo
|
8
|
+
$ git clone git@github.com:bramswenson/vimpack.git
|
9
|
+
$ cd vimpack
|
10
|
+
$ bundle install
|
11
|
+
$ rake build
|
12
|
+
$ gem install pkg/vimpack-0.0.1.gem
|
13
|
+
$ rake cucumber (if you want to run the tests)
|
14
|
+
|
15
|
+
$ vimpack init
|
16
|
+
* backing up existing vim environment
|
17
|
+
* initializing vimpack repo
|
18
|
+
* installing pathogen.vim
|
19
|
+
* initializing .vimrc
|
20
|
+
vimpack initialized!
|
21
|
+
|
22
|
+
$ vimpack search rails
|
23
|
+
rails.vim utility
|
24
|
+
railscast colorscheme
|
25
|
+
Railscast There (GUI&256color) colorscheme
|
26
|
+
railstab.vim utility
|
27
|
+
FastGrep utility
|
28
|
+
apidock.vim utility
|
29
|
+
grails-vim utility
|
30
|
+
|
31
|
+
$ vimpack info rails.vim
|
32
|
+
Name: rails.vim
|
33
|
+
Author: Tim Pope
|
34
|
+
Version: 4.3
|
35
|
+
Description: Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more
|
36
|
+
|
37
|
+
$ vimpack install rails.vim
|
38
|
+
* installing rails.vim
|
39
|
+
rails.vim (4.3) installed!
|
40
|
+
|
41
|
+
$ vimpack list
|
42
|
+
rails.vim
|
43
|
+
|
44
|
+
$ vimpack uninstall rails.vim
|
45
|
+
* uninstalling rails.vim
|
46
|
+
rails.vim uninstalled!
|
47
|
+
|
data/Rakefile
ADDED
data/bin/vimpack
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
begin
|
5
|
+
require 'vimpack'
|
6
|
+
rescue LoadError => e
|
7
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
8
|
+
require 'vimpack'
|
9
|
+
end
|
10
|
+
|
11
|
+
USAGE = <<-EOU
|
12
|
+
Manage bundles of vim scripts and vimrc
|
13
|
+
|
14
|
+
Usage:
|
15
|
+
|
16
|
+
vimpack <subcommand>
|
17
|
+
vimpack <subcommand> --help - Get more detailed help on subcommands
|
18
|
+
vimpack init [repo_url] - Initialize vimpack repository
|
19
|
+
vimpack search <string> - Search for scripts
|
20
|
+
vimpack install <script_name> - Install scripts
|
21
|
+
vimpack uninstall <script_name> - Uninstall scripts
|
22
|
+
vimpack list - List installed scripts
|
23
|
+
vimpack info <script_name> - Get detailed info on a script
|
24
|
+
vimpack git publish -m <message> - Publish vimpack repo (shorthand for commit and push)
|
25
|
+
vimpack git <git command> - Run any git command within the vimpack repo
|
26
|
+
EOU
|
27
|
+
|
28
|
+
SUB_COMMANDS = %w{ init search install uninstall list info git }
|
29
|
+
global_options = Trollop::options do
|
30
|
+
version 'vimpack 0.0.1 (c) 2011 Bram Swenson'
|
31
|
+
banner USAGE
|
32
|
+
opt :environment, 'The environment to run vimpack within', :short => '-e', :default => 'production'
|
33
|
+
stop_on SUB_COMMANDS
|
34
|
+
end
|
35
|
+
|
36
|
+
cmd = ARGV.shift
|
37
|
+
unless SUB_COMMANDS.include?(cmd)
|
38
|
+
Trollop::die USAGE
|
39
|
+
end
|
40
|
+
|
41
|
+
case cmd
|
42
|
+
when 'init'
|
43
|
+
options = Trollop::options do
|
44
|
+
banner 'vimpack init [repo_url] - Initialize vimpack repository'
|
45
|
+
opt :home_directory, 'The home directory of the user', :short => '-d', :default => ENV['HOME']
|
46
|
+
end
|
47
|
+
Vimpack::Commands::Init.run(options, global_options)
|
48
|
+
when 'search'
|
49
|
+
options = Trollop::options do
|
50
|
+
banner 'vimpack search <string> - Search for vim scripts'
|
51
|
+
opt :utility, 'Search for utility scripts', :short => '-u'
|
52
|
+
opt :color_scheme, 'Search for color scheme scripts', :short => '-c'
|
53
|
+
opt :syntax, 'Search for syntax scripts', :short => '-s'
|
54
|
+
opt :indent, 'Search for indent scripts', :short => '-i'
|
55
|
+
opt :game, 'Search for game scripts', :short => '-g'
|
56
|
+
opt :plugin, 'Search for plugin scripts', :short => '-p'
|
57
|
+
opt :patch, 'Search for patch scripts', :short => '-a'
|
58
|
+
end
|
59
|
+
Vimpack::Commands::Search.run(options, global_options)
|
60
|
+
when 'install'
|
61
|
+
options = Trollop::options do
|
62
|
+
banner 'vimpack install <script_name> [script_name] - Install vim scripts'
|
63
|
+
end
|
64
|
+
Vimpack::Commands::Install.run(options, global_options)
|
65
|
+
when 'uninstall'
|
66
|
+
options = Trollop::options do
|
67
|
+
banner 'vimpack uninstall <script_name> [script_name] - Uninstall vim scripts'
|
68
|
+
end
|
69
|
+
Vimpack::Commands::Uninstall.run(options, global_options)
|
70
|
+
when 'list'
|
71
|
+
options = Trollop::options do
|
72
|
+
banner 'vimpack list - List installed vim scripts'
|
73
|
+
end
|
74
|
+
Vimpack::Commands::List.run(options, global_options)
|
75
|
+
when 'info'
|
76
|
+
options = Trollop::options do
|
77
|
+
banner 'vimpack info <script_name> - Get detailed information on a vim script'
|
78
|
+
end
|
79
|
+
Vimpack::Commands::Info.run(options, global_options)
|
80
|
+
when 'git'
|
81
|
+
the_banner = <<-EOB
|
82
|
+
vimpack git publish -m <message> - Publish vimpack repo (shorthand for commit and push)
|
83
|
+
vimpack git <git command> - Run any git command within the vimpack repo
|
84
|
+
EOB
|
85
|
+
git_command = ARGV.shift
|
86
|
+
parser = Trollop::Parser.new do
|
87
|
+
opt :message, 'publish message', :short => '-m',
|
88
|
+
:default => '[VIMPACK] vimpack publish' if git_command == 'publish'
|
89
|
+
banner the_banner
|
90
|
+
end
|
91
|
+
begin
|
92
|
+
options = parser.parse ARGV
|
93
|
+
rescue Trollop::CommandlineError => e
|
94
|
+
raise e if git_command == 'publish'
|
95
|
+
options = {}
|
96
|
+
end
|
97
|
+
ARGV.unshift git_command
|
98
|
+
Vimpack::Commands::Git.run(options, global_options)
|
99
|
+
else
|
100
|
+
puts "command not found: #{cmd}"
|
101
|
+
Trollop::die USAGE
|
102
|
+
end
|
103
|
+
|
data/cucumber.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
<%
|
2
|
+
opts = '--color --require features'
|
3
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
4
|
+
rerun_opts = rerun.to_s.strip.empty? ?
|
5
|
+
"#{opts} --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} features" :
|
6
|
+
"#{opts} --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
7
|
+
std_opts = "#{opts} --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
8
|
+
%>
|
9
|
+
default: <%= std_opts %> features
|
10
|
+
wip: <%= opts %> --tags @wip:3 --wip features
|
11
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
12
|
+
autotest: <%= std_opts %>
|
13
|
+
autotest-all: <%= std_opts %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: Use different environments for vimpack
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to use different environments
|
5
|
+
Mostly so I can test vimpack
|
6
|
+
|
7
|
+
Background: Setup test directories
|
8
|
+
Given a directory named "test_vimpack/.vim"
|
9
|
+
And an empty file named "test_vimpack/.vimrc"
|
10
|
+
And "test_vimpack" is my home directory
|
11
|
+
|
12
|
+
Scenario: Default environment should be production and should not alert
|
13
|
+
When I run `vimpack init`
|
14
|
+
Then the output should not contain " * using production environment!"
|
15
|
+
And the exit status should be 0
|
16
|
+
|
17
|
+
Scenario: When not in production environment we should be alerted
|
18
|
+
When I run `vimpack --environment development init`
|
19
|
+
Then the output should contain:
|
20
|
+
"""
|
21
|
+
* using environment :development
|
22
|
+
"""
|
23
|
+
And the output should not contain " * using production environment"
|
24
|
+
And the exit status should be 0
|
25
|
+
|
26
|
+
|
@@ -0,0 +1,77 @@
|
|
1
|
+
Feature: Manage vimpack -e development git repo
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want manage my vimpack -e development git repo
|
5
|
+
So I can easily replicate my vimpack
|
6
|
+
|
7
|
+
Scenario: Publish vimpack to empty git repo
|
8
|
+
Given an initialized vimpack in "test_vimpack"
|
9
|
+
And an initialized git repo in "vimpack-repo"
|
10
|
+
And I run `vimpack -e development git remote add origin /tmp/aruba/vimpack-repo`
|
11
|
+
When I run `vimpack -e development git publish -m '[TEST] testing vimpack'`
|
12
|
+
Then the exit status should be 0
|
13
|
+
And the output should contain:
|
14
|
+
"""
|
15
|
+
* publishing vimpack repo
|
16
|
+
vimpack repo published!
|
17
|
+
"""
|
18
|
+
And the vimpack git remote "origin" should be "/tmp/aruba/vimpack-repo"
|
19
|
+
|
20
|
+
Scenario: Publish vimpack repo when out of sync
|
21
|
+
Given an initialized vimpack in "test_vimpack"
|
22
|
+
And "rails.vim" is already installed
|
23
|
+
And an existing git repo in "vimpack-repo"
|
24
|
+
And an initialized vimpack in "test_vimpack_remoted" from remote "vimpack-repo"
|
25
|
+
And "test_vimpack" is my home directory
|
26
|
+
And "cucumber.zip" is already installed
|
27
|
+
And I run `vimpack -e development git publish -m '[CUKE] added cucumber.zip'`
|
28
|
+
And "test_vimpack_remoted" is my home directory
|
29
|
+
And "haml.zip" is already installed
|
30
|
+
When I run `vimpack -e development git publish -m '[TEST] this is a fail!'`
|
31
|
+
Then the exit status should be 1
|
32
|
+
And the output should contain:
|
33
|
+
"""
|
34
|
+
error: local repo out of sync with remote
|
35
|
+
use git to sync with something like this:
|
36
|
+
vimpack git fetch && vimpack git merge origin/master
|
37
|
+
"""
|
38
|
+
|
39
|
+
Scenario: Initialize vimpack -e development git remote
|
40
|
+
Given an initialized vimpack in "test_vimpack"
|
41
|
+
And an initialized git repo in "vimpack-repo"
|
42
|
+
When I run `vimpack -e development git remote add origin /tmp/aruba/vimpack-repo`
|
43
|
+
Then the exit status should be 0
|
44
|
+
And the output should contain:
|
45
|
+
"""
|
46
|
+
* running git remote add origin /tmp/aruba/vimpack-repo
|
47
|
+
command complete!
|
48
|
+
"""
|
49
|
+
And the vimpack git remote "origin" should be "/tmp/aruba/vimpack-repo"
|
50
|
+
|
51
|
+
Scenario: Commit vimpack -e development git repo with commit message
|
52
|
+
Given an initialized vimpack in "test_vimpack"
|
53
|
+
And an initialized git repo in "vimpack-repo"
|
54
|
+
And I run `vimpack -e development git remote add origin /tmp/aruba/vimpack-repo`
|
55
|
+
When I run `vimpack -e development git add . `
|
56
|
+
And I run `vimpack -e development git commit -m '[TEST] test commit'`
|
57
|
+
Then the exit status should be 0
|
58
|
+
And the output should contain:
|
59
|
+
"""
|
60
|
+
* running git commit -m [TEST] test commit
|
61
|
+
command complete!
|
62
|
+
"""
|
63
|
+
And the vimpack git commit logs last message should be "[TEST] test commit"
|
64
|
+
|
65
|
+
Scenario: Publish vimpack -e development git repo
|
66
|
+
Given an initialized vimpack in "test_vimpack"
|
67
|
+
And an initialized git repo in "vimpack-repo"
|
68
|
+
And I run `vimpack -e development git remote add origin /tmp/aruba/vimpack-repo`
|
69
|
+
And "rails.vim" is already installed
|
70
|
+
When I run `vimpack -e development git publish`
|
71
|
+
Then the exit status should be 0
|
72
|
+
And the output should contain:
|
73
|
+
"""
|
74
|
+
* publishing vimpack repo
|
75
|
+
vimpack repo published!
|
76
|
+
"""
|
77
|
+
And the vimpack git status should be empty
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Get information about a script
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to get information about a vim script
|
5
|
+
So I know more about what I am working with
|
6
|
+
|
7
|
+
Scenario: Get script detailed information
|
8
|
+
Given an initialized vimpack in "test_vimpack"
|
9
|
+
When I run `vimpack -e development info rails.vim`
|
10
|
+
Then the output should contain:
|
11
|
+
"""
|
12
|
+
Name: rails.vim
|
13
|
+
Author: Tim Pope
|
14
|
+
Version: 4.3 (2010-09-09T17:00:00-07:00)
|
15
|
+
Type: utility
|
16
|
+
Description: Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more
|
17
|
+
"""
|
18
|
+
And the exit status should be 0
|
19
|
+
|
20
|
+
Scenario: Try to get info for a script that does not exist
|
21
|
+
Given an initialized vimpack in "test_vimpack"
|
22
|
+
When I run `vimpack -e development info this_does_not_exists_i_swear`
|
23
|
+
Then the output should contain:
|
24
|
+
"""
|
25
|
+
Script not found!
|
26
|
+
"""
|
27
|
+
And the exit status should be 1
|
28
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
Feature: Initialize vimpack
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to initialize vimpack
|
5
|
+
So I can have a sane way to manage vim scripts
|
6
|
+
|
7
|
+
Scenario: Initialize vimpack in an existing vim environment
|
8
|
+
Given a directory named "test_vimpack/.vim"
|
9
|
+
And an empty file named "test_vimpack/.vimrc"
|
10
|
+
And "test_vimpack" is my home directory
|
11
|
+
When I run `vimpack -e development init`
|
12
|
+
Then a directory named "test_vimpack/.vim.before_vimpack" should exist
|
13
|
+
And a file named "test_vimpack/.vimrc.before_vimpack" should exist
|
14
|
+
And the output should contain " * initializing vimpack repo"
|
15
|
+
And a directory named "test_vimpack/.vimpack" should exist and be a git repo
|
16
|
+
And a directory named "test_vimpack/.vimpack/vim" should exist
|
17
|
+
And a directory named "test_vimpack/.vimpack/vim/autoload" should exist
|
18
|
+
And a directory named "test_vimpack/.vimpack/vim/bundle" should exist
|
19
|
+
And a directory named "test_vimpack/.vimpack/scripts" should exist
|
20
|
+
And a symlink named "test_vimpack/.vim" should exist and link to "test_vimpack/.vimpack/vim"
|
21
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/pathogen.vim" should exist and be a git submodule of "test_vimpack/.vimpack"
|
22
|
+
And a symlink named "test_vimpack/.vimpack/vim/autoload/pathogen.vim" should exist and link to "test_vimpack/.vimpack/scripts/utility/pathogen.vim/plugin/pathogen.vim"
|
23
|
+
And a symlink named "test_vimpack/.vimrc" should exist and link to "test_vimpack/.vimpack/vimrc"
|
24
|
+
And the output should contain "vimpack initialized!"
|
25
|
+
And the exit status should be 0
|
26
|
+
|
27
|
+
Scenario: Initialize vimpack from git repo
|
28
|
+
Given a directory named "test_vimpack/.vim"
|
29
|
+
And an empty file named "test_vimpack/.vimrc"
|
30
|
+
And "test_vimpack" is my home directory
|
31
|
+
When I run `vimpack -e development init git@github.com:bramswenson/vimpack-repo-test.git`
|
32
|
+
Then a directory named "test_vimpack/.vim.before_vimpack" should exist
|
33
|
+
And a file named "test_vimpack/.vimrc.before_vimpack" should exist
|
34
|
+
And the output should contain " * initializing vimpack repo from git@github.com:bramswenson/vimpack-repo-test.git"
|
35
|
+
And a directory named "test_vimpack/.vimpack" should exist and be a git repo
|
36
|
+
And a directory named "test_vimpack/.vimpack/vim" should exist
|
37
|
+
And a directory named "test_vimpack/.vimpack/vim/autoload" should exist
|
38
|
+
And a directory named "test_vimpack/.vimpack/vim/bundle" should exist
|
39
|
+
And a directory named "test_vimpack/.vimpack/scripts" should exist
|
40
|
+
And a symlink named "test_vimpack/.vim" should exist and link to "test_vimpack/.vimpack/vim"
|
41
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/pathogen.vim" should exist and be a git submodule of "test_vimpack/.vimpack"
|
42
|
+
And a symlink named "test_vimpack/.vimpack/vim/autoload/pathogen.vim" should exist and link to "test_vimpack/.vimpack/scripts/utility/pathogen.vim/plugin/pathogen.vim"
|
43
|
+
And a symlink named "test_vimpack/.vimrc" should exist and link to "test_vimpack/.vimpack/vimrc"
|
44
|
+
And the output should contain "vimpack initialized!"
|
45
|
+
And the vimpack git remote "origin" should be "git@github.com:bramswenson/vimpack-repo-test.git"
|
46
|
+
And the exit status should be 0
|
47
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
Feature: Install a vim script
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to install a vim script
|
5
|
+
So I can use it in vim
|
6
|
+
|
7
|
+
Scenario: Install a script
|
8
|
+
Given an initialized vimpack in "test_vimpack"
|
9
|
+
When I run `vimpack -e development install rails.vim`
|
10
|
+
Then the output should contain:
|
11
|
+
"""
|
12
|
+
* installing rails.vim
|
13
|
+
rails.vim (4.3) installed!
|
14
|
+
"""
|
15
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/rails.vim" should exist and be a git submodule of "test_vimpack/.vimpack"
|
16
|
+
And a symlink named "test_vimpack/.vimpack/vim/bundle/rails.vim" should exist and link to "test_vimpack/.vimpack/scripts/utility/rails.vim"
|
17
|
+
And the exit status should be 0
|
18
|
+
|
19
|
+
Scenario: Install multiple scripts
|
20
|
+
Given an initialized vimpack in "test_vimpack"
|
21
|
+
When I run `vimpack -e development install rails.vim cucumber.zip`
|
22
|
+
Then the output should contain:
|
23
|
+
"""
|
24
|
+
* installing rails.vim
|
25
|
+
rails.vim (4.3) installed!
|
26
|
+
* installing cucumber.zip
|
27
|
+
cucumber.zip (1.0) installed!
|
28
|
+
"""
|
29
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/rails.vim" should exist and be a git submodule of "test_vimpack/.vimpack"
|
30
|
+
And a symlink named "test_vimpack/.vimpack/vim/bundle/rails.vim" should exist and link to "test_vimpack/.vimpack/scripts/utility/rails.vim"
|
31
|
+
And the exit status should be 0
|
32
|
+
|
33
|
+
Scenario: Attempt to install a script that is not found
|
34
|
+
Given an initialized vimpack in "test_vimpack"
|
35
|
+
When I run `vimpack -e development install railz`
|
36
|
+
Then the output should contain:
|
37
|
+
"""
|
38
|
+
Script not found!
|
39
|
+
"""
|
40
|
+
And the exit status should be 1
|
41
|
+
|
42
|
+
Scenario: Attempt to install a script that is not found but a fuzzy match is found
|
43
|
+
Given an initialized vimpack in "test_vimpack"
|
44
|
+
When I run `vimpack -e development install cucumber`
|
45
|
+
Then the output should contain:
|
46
|
+
"""
|
47
|
+
Script not found! Did you mean cucumber.zip?
|
48
|
+
"""
|
49
|
+
And the exit status should be 1
|
50
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Feature: List installed vim script
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to list installed vim script
|
5
|
+
So I know what I am working with
|
6
|
+
|
7
|
+
Scenario: List installed vim scripts
|
8
|
+
Given an initialized vimpack in "test_vimpack"
|
9
|
+
And "rails.vim" is already installed
|
10
|
+
And "railscasts" is already installed
|
11
|
+
When I run `vimpack -e development list`
|
12
|
+
Then the stdout should contain:
|
13
|
+
"""
|
14
|
+
rails.vim
|
15
|
+
railscasts
|
16
|
+
"""
|
17
|
+
And the exit status should be 0
|
18
|
+
|
@@ -0,0 +1,137 @@
|
|
1
|
+
Feature: Search for a vim script
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to search for a vim script
|
5
|
+
So I can find a script to install
|
6
|
+
|
7
|
+
Scenario: Search for a script
|
8
|
+
Given an initialized vimpack in "test_vimpack"
|
9
|
+
When I run `vimpack -e development search rails`
|
10
|
+
Then the output should contain:
|
11
|
+
"""
|
12
|
+
rails.vim utility
|
13
|
+
railscasts color scheme
|
14
|
+
Railscasts-Theme-GUIand256color color scheme
|
15
|
+
railstab.vim utility
|
16
|
+
FastGrep utility
|
17
|
+
apidock.vim utility
|
18
|
+
grails-vim utility
|
19
|
+
paper color scheme
|
20
|
+
"""
|
21
|
+
And the exit status should be 0
|
22
|
+
|
23
|
+
Scenario: Search for a script within multiple script_types
|
24
|
+
Given an initialized vimpack in "test_vimpack"
|
25
|
+
When I run `vimpack -e development search --utility --color-scheme rails`
|
26
|
+
Then the output should contain:
|
27
|
+
"""
|
28
|
+
rails.vim utility
|
29
|
+
railscasts color scheme
|
30
|
+
Railscasts-Theme-GUIand256color color scheme
|
31
|
+
railstab.vim utility
|
32
|
+
FastGrep utility
|
33
|
+
apidock.vim utility
|
34
|
+
grails-vim utility
|
35
|
+
paper color scheme
|
36
|
+
"""
|
37
|
+
And the exit status should be 0
|
38
|
+
|
39
|
+
Scenario: Search for a utility script
|
40
|
+
Given an initialized vimpack in "test_vimpack"
|
41
|
+
When I run `vimpack -e development search --utility rails`
|
42
|
+
Then the output should contain:
|
43
|
+
"""
|
44
|
+
rails.vim utility
|
45
|
+
railstab.vim utility
|
46
|
+
FastGrep utility
|
47
|
+
apidock.vim utility
|
48
|
+
grails-vim utility
|
49
|
+
"""
|
50
|
+
And the exit status should be 0
|
51
|
+
|
52
|
+
Scenario: Search for all utility scripts
|
53
|
+
Given an initialized vimpack in "test_vimpack"
|
54
|
+
When I run `vimpack -e development search --utility`
|
55
|
+
Then the output should contain:
|
56
|
+
"""
|
57
|
+
test.vim utility
|
58
|
+
test.zip utility
|
59
|
+
ToggleCommentify.vim utility
|
60
|
+
keepcase.vim utility
|
61
|
+
vimbuddy.vim utility
|
62
|
+
buffoptions.vim utility
|
63
|
+
fortune.vim utility
|
64
|
+
drawing.vim utility
|
65
|
+
ctags.vim utility
|
66
|
+
closetag.vim utility
|
67
|
+
"""
|
68
|
+
And the exit status should be 0
|
69
|
+
|
70
|
+
Scenario: Search for a color scheme script
|
71
|
+
Given an initialized vimpack in "test_vimpack"
|
72
|
+
When I run `vimpack -e development search --color-scheme rails`
|
73
|
+
Then the output should contain:
|
74
|
+
"""
|
75
|
+
railscasts color scheme
|
76
|
+
Railscasts-Theme-GUIand256color color scheme
|
77
|
+
paper color scheme
|
78
|
+
"""
|
79
|
+
And the exit status should be 0
|
80
|
+
|
81
|
+
Scenario: Search for a syntax script
|
82
|
+
Given an initialized vimpack in "test_vimpack"
|
83
|
+
When I run `vimpack -e development search --syntax haml`
|
84
|
+
Then the output should contain:
|
85
|
+
"""
|
86
|
+
haml.zip syntax
|
87
|
+
Haml syntax
|
88
|
+
"""
|
89
|
+
And the exit status should be 0
|
90
|
+
|
91
|
+
Scenario: Search for an indent script
|
92
|
+
Given an initialized vimpack in "test_vimpack"
|
93
|
+
When I run `vimpack -e development search --indent ruby`
|
94
|
+
Then the output should contain:
|
95
|
+
"""
|
96
|
+
indentruby.vim indent
|
97
|
+
ruby.vim--IGREQUE indent
|
98
|
+
"""
|
99
|
+
And the exit status should be 0
|
100
|
+
|
101
|
+
Scenario: Search for a game script
|
102
|
+
Given an initialized vimpack in "test_vimpack"
|
103
|
+
When I run `vimpack -e development search --game sudoku`
|
104
|
+
Then the output should contain:
|
105
|
+
"""
|
106
|
+
sudoku game
|
107
|
+
Sudoku-Solver game
|
108
|
+
"""
|
109
|
+
And the exit status should be 0
|
110
|
+
|
111
|
+
Scenario: Search for a plugin script
|
112
|
+
Given an initialized vimpack in "test_vimpack"
|
113
|
+
When I run `vimpack -e development search --plugin apt`
|
114
|
+
Then the output should contain:
|
115
|
+
"""
|
116
|
+
apt-complete.vim plugin
|
117
|
+
"""
|
118
|
+
And the exit status should be 0
|
119
|
+
|
120
|
+
Scenario: Search for a patch script
|
121
|
+
Given an initialized vimpack in "test_vimpack"
|
122
|
+
When I run `vimpack -e development search --patch start`
|
123
|
+
Then the output should contain:
|
124
|
+
"""
|
125
|
+
startup_profile patch
|
126
|
+
"""
|
127
|
+
And the exit status should be 0
|
128
|
+
|
129
|
+
Scenario: Search for an unknown script
|
130
|
+
Given an initialized vimpack in "test_vimpack"
|
131
|
+
When I run `vimpack -e development search this_does_not_exist_anywhere_right`
|
132
|
+
Then the output should contain:
|
133
|
+
"""
|
134
|
+
No scripts found!
|
135
|
+
"""
|
136
|
+
And the exit status should be 0
|
137
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
Feature: Uninstall a vim script
|
2
|
+
|
3
|
+
As a vimpack user
|
4
|
+
I want to uninstall a vim script
|
5
|
+
So its not taking up space
|
6
|
+
|
7
|
+
Scenario: Uninstall a script
|
8
|
+
Given an initialized vimpack in "test_vimpack"
|
9
|
+
And "rails.vim" is already installed
|
10
|
+
When I run `vimpack -e development uninstall rails.vim`
|
11
|
+
Then the output should contain:
|
12
|
+
"""
|
13
|
+
* uninstalling rails.vim
|
14
|
+
rails.vim uninstalled!
|
15
|
+
"""
|
16
|
+
And a symlink named "test_vimpack/.vimpack/vim/bundle/rails.vim" should not exist
|
17
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/rails.vim" should not exist
|
18
|
+
And the exit status should be 0
|
19
|
+
|
20
|
+
Scenario: Uninstall multiple scripts
|
21
|
+
Given an initialized vimpack in "test_vimpack"
|
22
|
+
And "rails.vim" is already installed
|
23
|
+
And "cucumber.zip" is already installed
|
24
|
+
When I run `vimpack -e development uninstall rails.vim cucumber.zip`
|
25
|
+
Then the output should contain:
|
26
|
+
"""
|
27
|
+
* uninstalling rails.vim
|
28
|
+
rails.vim uninstalled!
|
29
|
+
* uninstalling cucumber.zip
|
30
|
+
cucumber.zip uninstalled!
|
31
|
+
"""
|
32
|
+
And a symlink named "test_vimpack/.vimpack/vim/bundle/rails.vim" should not exist
|
33
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/rails.vim" should not exist
|
34
|
+
And a symlink named "test_vimpack/.vimpack/vim/bundle/cucumber.zip" should not exist
|
35
|
+
And a directory named "test_vimpack/.vimpack/scripts/utility/cucumber.zip" should not exist
|
36
|
+
And the exit status should be 0
|
37
|
+
|
38
|
+
Scenario: Try Uninstall a script that is not installed
|
39
|
+
Given an initialized vimpack in "test_vimpack"
|
40
|
+
When I run `vimpack -e development uninstall rails.vim`
|
41
|
+
Then the output should contain:
|
42
|
+
"""
|
43
|
+
Script not found!
|
44
|
+
"""
|
45
|
+
And the exit status should be 1
|
46
|
+
|