vimdb 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
+
3
+ describe "vimdb opts" do
4
+ it "lists all options by default" do
5
+ vimdb 'opts'
6
+ stdout.must_match /359 rows/
7
+ end
8
+
9
+ it 'searches :name field by default' do
10
+ vimdb 'opts' ,'wildignorec'
11
+ stdout.must_match /1 row/
12
+ end
13
+ end
@@ -0,0 +1,58 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/helper')
2
+ require 'tempfile'
3
+
4
+ describe Vimdb::Runner do
5
+ describe "commands" do
6
+ it "help prints help" do
7
+ vimdb 'help'
8
+ stdout.must_match /vimdb commands.*vimdb keys.*vimdb opts/m
9
+ end
10
+
11
+ it "no arguments prints help" do
12
+ vimdb
13
+ stdout.must_match /vimdb commands.*vimdb keys.*vimdb opts/m
14
+ end
15
+
16
+ Vimdb::Item.all.each do |item|
17
+ it "info for #{item} prints info" do
18
+ vimdb 'info', item
19
+ stdout.must_match /^Created/
20
+ end
21
+ end
22
+ end
23
+
24
+ describe "rc file" do
25
+ before {
26
+ @old_rc = ENV['VIMDB_RC']
27
+ ENV['VIMDB_RC'] = Tempfile.new(Time.now.to_i.to_s).path
28
+ }
29
+ after { ENV['VIMDB_RC'] = @old_rc }
30
+
31
+ def rc_contains(str)
32
+ File.open(ENV['VIMDB_RC'], 'w') {|f| f.write str }
33
+ end
34
+
35
+ it "loads user-defined commands" do
36
+ rc_contains <<-RC
37
+ class Vimdb::Runner < Thor
38
+ desc 'new_task', ''
39
+ def new_task; end
40
+ end
41
+ RC
42
+
43
+ vimdb 'help', 'new_task'
44
+ stdout.must_match /vimdb new_task/
45
+ end
46
+
47
+ it "can be nonexistent" do
48
+ vimdb
49
+ process.success?.must_equal true
50
+ end
51
+
52
+ it "prints error when it fails to load" do
53
+ rc_contains 'FUUUU!'
54
+ vimdb
55
+ stderr.must_match /Error while loading/
56
+ end
57
+ end
58
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vimdb
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gabriel Horner
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-17 00:00:00 -04:00
13
+ date: 2011-10-24 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -35,6 +35,17 @@ dependencies:
35
35
  version: 0.5.0
36
36
  type: :runtime
37
37
  version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: minitest
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 2.5.1
47
+ type: :development
48
+ version_requirements: *id003
38
49
  description: Search your vim keybindings precisely by keystroke, mode, description or where they came from. Search vim options by name, alias and description.
39
50
  email: gabriel.horner@gmail.com
40
51
  executables:
@@ -45,6 +56,7 @@ extra_rdoc_files:
45
56
  - README.md
46
57
  - LICENSE.txt
47
58
  files:
59
+ - lib/vimdb/commands.rb
48
60
  - lib/vimdb/db.rb
49
61
  - lib/vimdb/item.rb
50
62
  - lib/vimdb/keys.rb
@@ -53,13 +65,26 @@ files:
53
65
  - lib/vimdb/user.rb
54
66
  - lib/vimdb/version.rb
55
67
  - lib/vimdb.rb
68
+ - spec/commands_spec.rb
69
+ - spec/helper.rb
70
+ - spec/keys_spec.rb
71
+ - spec/options_spec.rb
72
+ - spec/runner_spec.rb
56
73
  - bin/vimdb
57
74
  - LICENSE.txt
58
75
  - CHANGELOG.rdoc
59
76
  - README.md
60
77
  - deps.rip
78
+ - spec/deps.rip
61
79
  - Rakefile
62
80
  - .gemspec
81
+ - spec/fixtures/commands_command
82
+ - spec/fixtures/commands_index
83
+ - spec/fixtures/keys_index
84
+ - spec/fixtures/keys_leader
85
+ - spec/fixtures/keys_map
86
+ - spec/fixtures/options_help
87
+ - spec/.vimdbrc
63
88
  has_rdoc: true
64
89
  homepage: http://github.com/cldwalker/vimdb
65
90
  licenses: