noir 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/noir/command/completion.rb +1 -1
- data/lib/noir/version.rb +1 -1
- data/spec/noir/command/completion_spec.rb +5 -1
- data/spec/noir/command/new/gitignore/tex_spec.rb +6 -0
- data/spec/noir/command/new/gitignore/vim_spec.rb +6 -1
- data/spec/noir/command/new/makefile/tex_spec.rb +6 -0
- data/spec/noir/command/new/note_spec.rb +6 -0
- data/spec/spec_helper.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e75ca0cf76cf94e93f8a994d7c1433305ec350c0
|
4
|
+
data.tar.gz: 4499650c1082f3414535d8760eae4113d2dfbb0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e01f62105f5d9252ba87eca7182188fa33aa132053c919853aaccace7873c7d871dea25bae8500a2649f9b02de069d2e652188133af560ad9a0534cd1df0d3e
|
7
|
+
data.tar.gz: 54b910c877be17e8b0887a76358f2d8b860e8d1e9e0655db92466bc87272bab4bde97e5d0b73599799513ea3019e9be3fc94b4e5a66304e31a18e9eabca25808
|
@@ -34,7 +34,7 @@ class Noir::Command::Completion < Noir::Base::TerminalCommand
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def suggestions_from_command klass, pattern = nil
|
37
|
-
suggests = klass.
|
37
|
+
suggests = klass.sub_commands.map(&:to_s).map(&:downcase)
|
38
38
|
|
39
39
|
unless pattern.nil?
|
40
40
|
suggests = suggests.select{|c| c.start_with? pattern.downcase}
|
data/lib/noir/version.rb
CHANGED
@@ -18,7 +18,11 @@ describe 'Noir::Command::Completion' do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'return nil from unmatched pattern' do
|
21
|
-
expect(Noir::Command::Completion.suggestions(['
|
21
|
+
expect(Noir::Command::Completion.suggestions(['poyo'])).to eq([])
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'not has non-class constant' do
|
25
|
+
expect(Noir::Command::Completion.suggestions(['hoge'])).to_not include(:piyo)
|
22
26
|
end
|
23
27
|
|
24
28
|
it 'return matched command name' do
|
@@ -5,4 +5,10 @@ describe 'Noir::Command::New::GitIgnore::Tex' do
|
|
5
5
|
it 'is TerminalCommand' do
|
6
6
|
expect(Noir::Command::New::GitIgnore::Tex.superclass).to eq(Noir::Base::TerminalCommand)
|
7
7
|
end
|
8
|
+
|
9
|
+
it 'is create .gitignore by Noir::Command::New.createFile' do
|
10
|
+
allow(Noir::Command::New).to receive(:createFile)
|
11
|
+
expect(Noir::Command::New).to receive(:createFile).with('.gitignore', anything)
|
12
|
+
Noir::Command::New::GitIgnore::Tex.execute
|
13
|
+
end
|
8
14
|
end
|
@@ -5,6 +5,11 @@ describe 'Noir::Command::New::GitIgnore::Vim' do
|
|
5
5
|
it 'is TerminalCommand' do
|
6
6
|
expect(Noir::Command::New::GitIgnore::Vim.superclass).to eq(Noir::Base::TerminalCommand)
|
7
7
|
end
|
8
|
-
end
|
9
8
|
|
9
|
+
it 'is create .gitignore by Noir::Command::New.createFile' do
|
10
|
+
allow(Noir::Command::New).to receive(:createFile)
|
11
|
+
expect(Noir::Command::New).to receive(:createFile).with('.gitignore', anything)
|
12
|
+
Noir::Command::New::GitIgnore::Vim.execute
|
13
|
+
end
|
14
|
+
end
|
10
15
|
|
@@ -5,5 +5,11 @@ describe 'Noir::Command::New::Makefile::Tex' do
|
|
5
5
|
it 'is TerminalCommand' do
|
6
6
|
expect(Noir::Command::New::Makefile::Tex.superclass).to eq(Noir::Base::TerminalCommand)
|
7
7
|
end
|
8
|
+
|
9
|
+
it 'is create Makefile by Noir::Command::New.createFile' do
|
10
|
+
allow(Noir::Command::New).to receive(:createFile)
|
11
|
+
expect(Noir::Command::New).to receive(:createFile).with('Makefile', anything)
|
12
|
+
Noir::Command::New::Makefile::Tex.execute
|
13
|
+
end
|
8
14
|
end
|
9
15
|
|
@@ -5,4 +5,10 @@ describe 'Noir::Command::New::Note' do
|
|
5
5
|
it 'is TerminalCommand' do
|
6
6
|
expect(Noir::Command::New::Note.superclass).to eq(Noir::Base::TerminalCommand)
|
7
7
|
end
|
8
|
+
|
9
|
+
it 'is call Noir::Command::New::createFile on exec' do
|
10
|
+
allow(Noir::Command::New).to receive(:createFile)
|
11
|
+
expect(Noir::Command::New).to receive(:createFile)
|
12
|
+
expect{Noir::Command::New::Note.execute}.to output.to_stdout
|
13
|
+
end
|
8
14
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,6 +10,7 @@ def stub_commands
|
|
10
10
|
stub_const('Noir::Command::Hoge::SubCommand::SubSubCommand' , Class.new(Noir::Base::Command))
|
11
11
|
stub_const('Noir::Command::Hoge::SubCommand::SubSubNonCommand' , Class.new)
|
12
12
|
stub_const('Noir::Command::Hoge::SubCommandTwo' , Class.new(Noir::Base::Command))
|
13
|
+
stub_const('Noir::Command::Hoge::Piyo' , :piyo)
|
13
14
|
stub_const('Noir::Command::Hoge::SubNonCommand' , Class.new)
|
14
15
|
stub_const('Noir::Command::Fuga' , Class.new(Noir::Base::TerminalCommand))
|
15
16
|
stub_const('Noir::Command::FugaFuga' , Class.new(Noir::Base::TerminalCommand))
|
@@ -30,10 +31,11 @@ def stub_commands
|
|
30
31
|
|
31
32
|
class SubNonCommand
|
32
33
|
end
|
34
|
+
Piyo = :piyo
|
33
35
|
end
|
34
36
|
class Fuga < Noir::Base::TerminalCommand
|
35
37
|
end
|
36
|
-
class
|
38
|
+
class FugaFuga < Noir::Base::TerminalCommand
|
37
39
|
end
|
38
40
|
end
|
39
41
|
=end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- atton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|