noir 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87a92fb27d6501f841713ec7f5972152c1df2b02
4
- data.tar.gz: 3b4585476354ecdee659faf9c14f00f8fc89ff71
3
+ metadata.gz: e75ca0cf76cf94e93f8a994d7c1433305ec350c0
4
+ data.tar.gz: 4499650c1082f3414535d8760eae4113d2dfbb0c
5
5
  SHA512:
6
- metadata.gz: 730faf4b77365e52fa48aac8cd44b5de86678ebac29cbadabc4ce158c66232d7c4caef1ba26cda40479b09b5a08033a6fd714775a1a87e49ab62d6e9d514009b
7
- data.tar.gz: c4dd7f89a0f889d030737bfba74ccb43bc6f1ef11a74eeb7ec5bf792a951851af5b2e0bd8536ac06b829c5f4c59565adc4cc772a43c964b94a65d383746a9b83
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.constants(true).map(&:to_s).map(&:downcase)
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
@@ -1,3 +1,3 @@
1
1
  module Noir
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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(['piyo'])).to eq([])
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 Fuga < Noir::Base::TerminalCommand
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.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-04-29 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler