vim-flavor 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4ef7a20f9342dd512e0718eb6a151212432fcec
4
- data.tar.gz: 73942ac396f29a6f278822676295da7b00099b23
3
+ metadata.gz: 73cbe32362402bf8daa1f6951a8048e11dacf480
4
+ data.tar.gz: 14b6eee41cb928926aba70453825a08862471b67
5
5
  SHA512:
6
- metadata.gz: a06fb5d0199475b0ae4bbaadf70dd8bd7e241a2d3e55276abba9dcbcbe10dfa66103121d15491d1ac6a24fa25dbad9d2670b0d7e6f287458dae058a556ea23c3
7
- data.tar.gz: caad9086bf9c57fd5897d3203bb68724292b5d0a7dacc1929765e8634605f154a112e46d4f8b8374581327137de1e360e606e63c2a3e3b4e1714acbb117d3059
6
+ metadata.gz: 2f3b0ddc0fad3d8efcbddbced648050759c0b1fbb9ab8d0bf44ce7851da32b8df91a28611f829faca401f607710f2c45e66b4abc674f22c4e5b6f61f376b65fa
7
+ data.tar.gz: 95d6f8c557062bb1403affe71deb2bd187a0f29a1ffc7c329d40287ab2d2470360977072d2c341a3d42ed79047c8de13017a0113a85e3248b36398ddaadadf70
@@ -13,7 +13,7 @@ Feature: Basics
13
13
  And I disable network to the original repository of "foo"
14
14
 
15
15
  Scenario: Install plugins - locked and compatible with new flavorfile
16
- Given I remove the directory "home/.vim"
16
+ Given I delete the directory "home/.vim"
17
17
  When I run `vim-flavor install`
18
18
  Then it should pass
19
19
  And a lockfile is created with:
data/features/news.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## vim-flavor 2.2.0
2
+
3
+ ### Enhancements
4
+
5
+ * `test` runs `*.vim` and `*.t` in a single step, to get a simplified result.
6
+ * `test` uses [vim-vspec](https://github.com/kana/vim-vspec) 1.5 or later by
7
+ default.
8
+ * `test` supports `--update-dependencies` to update dependencies before running
9
+ tests.
10
+
11
+
12
+
13
+
1
14
  ## vim-flavor 2.1.1
2
15
 
3
16
  ### Enhancements
@@ -1,6 +1,8 @@
1
- When /^I remove the directory "([^"]*)"$/ do |dir_name|
1
+ When /^I delete the directory "([^"]*)"$/ do |dir_name|
2
2
  in_current_dir do
3
3
  # FileUtils#rmdir cannot delete non-empty directories.
4
+ # TODO: Use aruba's "I remove the directory" step.
5
+ # Currently its implementation cannot delete git repositories.
4
6
  FileUtils.rm_r(dir_name)
5
7
  end
6
8
  end
@@ -65,7 +65,7 @@ end
65
65
 
66
66
  Given /^I disable network to the original repository of "([^"]*)"$/ do |basename|
67
67
  steps %Q{
68
- Given I remove the directory "#{make_repo_path(basename)}"
68
+ Given I delete the directory "#{make_repo_path(basename)}"
69
69
  }
70
70
  end
71
71
 
@@ -43,8 +43,6 @@ Feature: Dependencies
43
43
  kana/vim-vspec 1\.\d+(\.\d+)? ... done
44
44
  Completed.
45
45
  -------- Testing a Vim plugin
46
- Files=0, Tests=0, \d+ wallclock secs .*
47
- Result: NOTESTS
48
46
  t/basics.vim .. ok
49
47
  All tests successful.
50
48
  Files=1, Tests=1, \d+ wallclock secs .*
@@ -57,3 +55,55 @@ Feature: Dependencies
57
55
  """
58
56
  And a dependency "kana/vim-vspec" is stored in ".vim-flavor/deps"
59
57
  And a dependency "kana/vim-textobj-user" is stored in ".vim-flavor/deps"
58
+
59
+ Scenario: Update dependencies for testing
60
+ Given a flavorfile with:
61
+ """ruby
62
+ flavor 'kana/vim-textobj-user', '~> 0.3.0'
63
+ """
64
+ And a lockfile with:
65
+ """ruby
66
+ kana/vim-textobj-user (0.3.5)
67
+ """
68
+ And a directory named "t"
69
+ And I run `vim-flavor test`
70
+ And it should pass with regexp:
71
+ """
72
+ -------- Preparing dependencies
73
+ Checking versions...
74
+ Use kana/vim-textobj-user ... 0\.3\.5
75
+ Use kana/vim-vspec ... 1\.\d+(\.\d+)?
76
+ Deploying plugins...
77
+ kana/vim-textobj-user 0\.3\.5 ... done
78
+ kana/vim-vspec 1\.\d+(\.\d+)? ... done
79
+ Completed.
80
+ -------- Testing a Vim plugin
81
+ Files=0, Tests=0, \d+ wallclock secs .*
82
+ Result: NOTESTS
83
+ """
84
+ And a lockfile is updated and matches with:
85
+ """
86
+ kana/vim-textobj-user \(0\.3\.5\)
87
+ kana/vim-vspec \(1\.\d+(\.\d+)?\)
88
+ """
89
+ When I run `vim-flavor test --update-dependencies`
90
+ Then it should pass with regexp:
91
+ """
92
+ .*
93
+ -------- Preparing dependencies
94
+ Checking versions...
95
+ Use kana/vim-textobj-user ... 0\.3\.13
96
+ Use kana/vim-vspec ... 1\.\d+(\.\d+)?
97
+ Deploying plugins...
98
+ kana/vim-textobj-user 0\.3\.13 ... done
99
+ kana/vim-vspec 1\.\d+(\.\d+)? ... skipped \(already deployed\)
100
+ Completed.
101
+ -------- Testing a Vim plugin
102
+ Files=0, Tests=0, \d+ wallclock secs .*
103
+ Result: NOTESTS
104
+ """
105
+ And a lockfile is updated and matches with:
106
+ """
107
+ kana/vim-textobj-user \(0\.3\.13\)
108
+ kana/vim-vspec \(1\.\d+(\.\d+)?\)
109
+ """
@@ -34,8 +34,6 @@ Feature: Failures
34
34
  kana/vim-vspec 1\.\d+(\.\d+)? ... done
35
35
  Completed.
36
36
  -------- Testing a Vim plugin
37
- Files=0, Tests=0, 0 wallclock secs (.*)
38
- Result: NOTESTS
39
37
  t/basics.vim ..\s
40
38
  not ok 1 - g:foo is equal to 5
41
39
  # Expected g:foo == 5
@@ -42,13 +42,10 @@ Feature: Specifying test scripts
42
42
  kana/vim-vspec 1\.\d+(\.\d+)? ... done
43
43
  Completed.
44
44
  -------- Testing a Vim plugin
45
- spec/sh.t .. ok
46
- All tests successful.
47
- Files=1, Tests=1, \d+ wallclock secs .*
48
- Result: PASS
49
45
  spec/basics.vim .. ok
46
+ spec/sh.t ........ ok
50
47
  All tests successful.
51
- Files=1, Tests=1, \d+ wallclock secs .*
48
+ Files=2, Tests=2, \d+ wallclock secs .*
52
49
  Result: PASS
53
50
  """
54
51
  And a lockfile is created and matches with:
@@ -43,13 +43,10 @@ Feature: Typical usage
43
43
  kana/vim-vspec 1\.\d+(\.\d+)? ... done
44
44
  Completed.
45
45
  -------- Testing a Vim plugin
46
- t/sh.t .. ok
47
- All tests successful.
48
- Files=1, Tests=1, \d+ wallclock secs .*
49
- Result: PASS
50
46
  t/basics.vim .. ok
47
+ t/sh.t ........ ok
51
48
  All tests successful.
52
- Files=1, Tests=1, \d+ wallclock secs .*
49
+ Files=2, Tests=2, \d+ wallclock secs .*
53
50
  Result: PASS
54
51
  """
55
52
  And a lockfile is created and matches with:
@@ -35,9 +35,12 @@ module Vim
35
35
  end
36
36
 
37
37
  desc 'test [FILES or DIRS]',
38
- 'Test a Vim plugin in the current working directory.'
38
+ 'Run tests on a Vim plugin in the current working directory.'
39
+ method_option :update_dependencies,
40
+ :desc => 'Update dependencies for testing',
41
+ :type => :boolean
39
42
  def test(*files_or_dirs)
40
- Facade.new().test(files_or_dirs)
43
+ Facade.new().test(files_or_dirs, options)
41
44
  end
42
45
 
43
46
  desc 'version', 'Show the current version.'
@@ -17,16 +17,16 @@ module Vim
17
17
  install_or_update(:update, vimfiles_path)
18
18
  end
19
19
 
20
- def test(files_or_dirs)
20
+ def test(files_or_dirs, options)
21
21
  trace "-------- Preparing dependencies\n"
22
22
 
23
23
  flavorfile = FlavorFile.load_or_new(Dir.getwd().to_flavorfile_path)
24
- flavorfile.flavor 'kana/vim-vspec', '~> 1.0', :group => :development unless
24
+ flavorfile.flavor 'kana/vim-vspec', '~> 1.5', :group => :development unless
25
25
  flavorfile.flavor_table.has_key?('kana/vim-vspec')
26
26
  lockfile = LockFile.load_or_new(Dir.getwd().to_lockfile_path)
27
27
 
28
28
  refresh_flavors(
29
- :install,
29
+ options[:update_dependencies] ? :update : :install,
30
30
  flavorfile,
31
31
  lockfile,
32
32
  [:runtime, :development],
@@ -35,28 +35,18 @@ module Vim
35
35
 
36
36
  trace "-------- Testing a Vim plugin\n"
37
37
 
38
- prove_options = '--comments --failure --directives'
39
- deps_path = Dir.getwd().to_stash_path.to_deps_path
40
- vspec = "#{deps_path}/#{'kana/vim-vspec'.zap}/bin/vspec"
38
+ this_path = Dir.getwd()
39
+ deps_path = this_path.to_stash_path.to_deps_path
40
+ runner = "#{deps_path}/#{'kana/vim-vspec'.zap}/bin/prove-vspec"
41
41
  plugin_paths = lockfile.flavors.map {|f|
42
42
  "#{deps_path}/#{f.repo_name.zap}"
43
43
  }
44
- dirs = files_or_dirs.select {|p| File.directory?(p)}
45
- t_files = files_or_dirs.select {|p| File.file?(p) &&
46
- File.extname(p) == '.t'}
47
- vim_files = files_or_dirs.select {|p| File.file?(p) &&
48
- File.extname(p) == '.vim'}
49
- commands = []
50
- commands <<
51
- %Q{ prove --ext '.t' #{prove_options} \
52
- #{(dirs + t_files).shelljoin} } if files_or_dirs.none? or
53
- dirs.any? or t_files.any?
54
- commands <<
55
- %Q{ prove --ext '.vim' #{prove_options} \
56
- --exec '#{vspec} #{Dir.getwd()} #{plugin_paths.join(' ')}' \
57
- #{(dirs + vim_files).shelljoin} } if files_or_dirs.none? or
58
- dirs.any? or vim_files.any?
59
- succeeded = system(commands.join('&&'))
44
+ runtime_paths = ([this_path] + plugin_paths).flat_map {|p| ['-d', p]}
45
+ command =
46
+ %Q{ '#{runner}' \
47
+ #{runtime_paths.flat_map {|p| ['-d', p]}.shelljoin} \
48
+ #{files_or_dirs.shelljoin} }
49
+ succeeded = system(command)
60
50
  exit(1) unless succeeded
61
51
  end
62
52
 
@@ -1,6 +1,6 @@
1
1
  module Vim
2
2
  module Flavor
3
- VERSION = '2.1.1'
3
+ VERSION = '2.2.0'
4
4
 
5
5
  class Version
6
6
  def self.create(arg)
@@ -25,15 +25,15 @@ module Vim
25
25
 
26
26
  describe '::correct?' do
27
27
  it 'accept "X.Y.Z" style tags' do
28
- expect(v.correct?('1')).to be_true
29
- expect(v.correct?('1.2')).to be_true
30
- expect(v.correct?('1.2.3')).to be_true
28
+ expect(v.correct?('1')).to be_truthy
29
+ expect(v.correct?('1.2')).to be_truthy
30
+ expect(v.correct?('1.2.3')).to be_truthy
31
31
  end
32
32
 
33
33
  it 'accept "vX.Y.Z" style tags' do
34
- expect(v.correct?('v1')).to be_true
35
- expect(v.correct?('v1.2')).to be_true
36
- expect(v.correct?('v1.2.3')).to be_true
34
+ expect(v.correct?('v1')).to be_truthy
35
+ expect(v.correct?('v1.2')).to be_truthy
36
+ expect(v.correct?('v1.2.3')).to be_truthy
37
37
  end
38
38
  end
39
39
 
data/spec/version_spec.rb CHANGED
@@ -34,13 +34,13 @@ module Vim
34
34
 
35
35
  describe '::correct?' do
36
36
  it 'is an alias of PlainVersion::correct?' do
37
- expect(v.correct?('1')).to be_true
38
- expect(v.correct?('1.2')).to be_true
39
- expect(v.correct?('1.2.3')).to be_true
40
- expect(v.correct?('v1')).to be_true
41
- expect(v.correct?('v1.2')).to be_true
42
- expect(v.correct?('v1.2.3')).to be_true
43
- expect(v.correct?('vim7.4')).to be_false
37
+ expect(v.correct?('1')).to be_truthy
38
+ expect(v.correct?('1.2')).to be_truthy
39
+ expect(v.correct?('1.2.3')).to be_truthy
40
+ expect(v.correct?('v1')).to be_truthy
41
+ expect(v.correct?('v1.2')).to be_truthy
42
+ expect(v.correct?('v1.2.3')).to be_truthy
43
+ expect(v.correct?('vim7.4')).to be_falsey
44
44
  end
45
45
  end
46
46
  end
data/vim-flavor.gemspec CHANGED
@@ -18,11 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency('parslet', '~> 1.0')
22
- spec.add_dependency('thor', '~> 0.14')
21
+ spec.add_dependency('parslet', '~> 1.7')
22
+ spec.add_dependency('thor', '~> 0.19')
23
23
 
24
- spec.add_development_dependency('aruba', '~> 0.5')
25
- spec.add_development_dependency('cucumber', '~> 1.2')
24
+ spec.add_development_dependency('aruba', '~> 0.6')
25
+ spec.add_development_dependency('cucumber', '~> 1.3')
26
26
  spec.add_development_dependency('pry')
27
- spec.add_development_dependency('rspec', '~> 2.8')
27
+ spec.add_development_dependency('rspec', '~> 2.99')
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim-flavor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kana Natsuno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.14'
33
+ version: '0.19'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.14'
40
+ version: '0.19'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: aruba
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.5'
47
+ version: '0.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.5'
54
+ version: '0.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cucumber
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.2'
61
+ version: '1.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.2'
68
+ version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.8'
89
+ version: '2.99'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '2.8'
96
+ version: '2.99'
97
97
  description: A tool to manage your favorite Vim plugins
98
98
  email:
99
99
  - dev@whileimautomaton.net