nit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +1 -1
- data/lib/nit/lines.rb +2 -2
- data/lib/nit/version.rb +1 -1
- data/nit.gemspec +1 -1
- data/test/nit_test.rb +15 -0
- data/test/status_test.rb +9 -0
- data/test/test_helper.rb +20 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ce40cb00fbd0507889d52bf61b057450c613caa
|
4
|
+
data.tar.gz: 560e59c303756db72f2ceab112c9b59c35dd608e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9f0619293a6c4ae41ac59b8448a17000dab8aff956ed69e424831a234b79d124a463946e9b0531046860cf74f113514ab93ad02a2727067d781854046df6db
|
7
|
+
data.tar.gz: 5875f64c730b320ae5b3bb6c716c80f479cd899a034b72ef6ab41410310a19acb506b89b758ecba685a39acda2066f3711c31234f954a7446fc113058d27062c
|
data/CHANGES.md
CHANGED
data/lib/nit/lines.rb
CHANGED
data/lib/nit/version.rb
CHANGED
data/nit.gemspec
CHANGED
@@ -18,7 +18,7 @@ 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 "thor",
|
21
|
+
spec.add_dependency "thor", '~> 0.18', '>= 0.18.1'
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
24
|
spec.add_development_dependency "rake"
|
data/test/nit_test.rb
CHANGED
@@ -25,6 +25,8 @@ class NitTest < MiniTest::Spec
|
|
25
25
|
`mkdir stage`
|
26
26
|
`cp -R git stage/.git`
|
27
27
|
`cp files/* stage/`
|
28
|
+
|
29
|
+
yield if block_given?
|
28
30
|
end
|
29
31
|
|
30
32
|
Dir.chdir "test/dummies/stage" do
|
@@ -58,6 +60,19 @@ class ArbitraryGitCommandsTest < NitTest
|
|
58
60
|
output.must_match "1 file changed" # TODO: check if correct file was commited.
|
59
61
|
end
|
60
62
|
|
63
|
+
# FIXME: with one changed, one new file!!!
|
64
|
+
it "what" do
|
65
|
+
output = nit(' ') do
|
66
|
+
`touch stage/new_file`
|
67
|
+
`cd stage && git add stage/new_file`
|
68
|
+
end
|
69
|
+
puts output
|
70
|
+
output.must_match "] fixing it\n"
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
61
76
|
# it "allows -m after file indices" do
|
62
77
|
# output = nit(' co ab -m add something 4 u')
|
63
78
|
# puts output
|
data/test/status_test.rb
CHANGED
@@ -20,6 +20,15 @@ class StatusTest < MiniTest::Spec
|
|
20
20
|
console.must_match "[3] new.rb"
|
21
21
|
console.must_match "[5] db/migrate/"
|
22
22
|
end
|
23
|
+
|
24
|
+
it "processes `git status` without #" do
|
25
|
+
console = subject.call([], output)
|
26
|
+
console.must_match "modified: [0] on_stage.rb"
|
27
|
+
console.must_match "modified: [1] staged.rb"
|
28
|
+
console.must_match "[2] brandnew.rb"
|
29
|
+
console.must_match "[3] new.rb"
|
30
|
+
console.must_match "[5] db/migrate/"
|
31
|
+
end
|
23
32
|
end
|
24
33
|
|
25
34
|
describe "char indexing" do
|
data/test/test_helper.rb
CHANGED
@@ -21,4 +21,24 @@ MiniTest::Spec.class_eval do
|
|
21
21
|
no changes added to commit (use "git add" and/or "git commit -a")
|
22
22
|
EOF
|
23
23
|
end
|
24
|
+
|
25
|
+
let (:hashless_output) do <<-EOF
|
26
|
+
On branch master
|
27
|
+
Changes not staged for commit:
|
28
|
+
(use "git add <file>..." to update what will be committed)
|
29
|
+
(use "git checkout -- <file>..." to discard changes in working directory)
|
30
|
+
|
31
|
+
\tmodified: on_stage.rb
|
32
|
+
\tmodified: staged.rb
|
33
|
+
|
34
|
+
Untracked files:
|
35
|
+
(use "git add <file>..." to include in what will be committed)
|
36
|
+
|
37
|
+
\tbrandnew.rb
|
38
|
+
\tnew.rb
|
39
|
+
\t../lib/new.rb
|
40
|
+
\tdb/migrate/
|
41
|
+
no changes added to commit (use "git add" and/or "git commit -a")
|
42
|
+
EOF
|
43
|
+
end
|
24
44
|
end
|
metadata
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.18'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 0.18.1
|
20
23
|
type: :runtime
|
@@ -22,6 +25,9 @@ dependencies:
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.18'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 0.18.1
|
27
33
|
- !ruby/object:Gem::Dependency
|