hexlet 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hexlet.rb +0 -1
- data/lib/hexlet/member_cli.rb +7 -2
- data/lib/hexlet/version.rb +1 -1
- data/locales/en.membercli.yml +4 -0
- data/test/hexlet/member_cli_test.rb +27 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d33a80460e2a9cf965e5dd657f54b1df6bee58e
|
4
|
+
data.tar.gz: c6e11a928c0c0281fb7e8e833ed111ea0a6cb3b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44b3036817aa7dc72bfd7317bc1ccf3698d05c9a8f647e839a93148e2802e67712760dd1242965eaf6edef7a4cb8ffcb0c4e796da386a847db45dcd5f91e7ae0
|
7
|
+
data.tar.gz: ba0e2f32cf61b18f967277d5f9e5fdd93a153c6458e19f199557fab25fed02ee6b3893e9a3908f9691bbc29d20af4b783fb789c02ecd02bbe79aa45f52e41169
|
data/lib/hexlet.rb
CHANGED
data/lib/hexlet/member_cli.rb
CHANGED
@@ -28,6 +28,7 @@ module Hexlet
|
|
28
28
|
else
|
29
29
|
puts (t :bad_tests)
|
30
30
|
puts e
|
31
|
+
false
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
@@ -44,12 +45,16 @@ module Hexlet
|
|
44
45
|
f.write content
|
45
46
|
end
|
46
47
|
|
47
|
-
|
48
|
-
|
48
|
+
unless ENV['TEST'] # FIXME
|
49
|
+
tgz = Zlib::GzipReader.new(File.open(tarball_path, 'rb'))
|
50
|
+
Archive::Tar::Minitar.unpack(tgz, exercise_path)
|
51
|
+
end
|
49
52
|
|
50
53
|
puts (t :ok)
|
54
|
+
true
|
51
55
|
else
|
52
56
|
puts (t :not_found)
|
57
|
+
false
|
53
58
|
end
|
54
59
|
end
|
55
60
|
|
data/lib/hexlet/version.rb
CHANGED
data/locales/en.membercli.yml
CHANGED
@@ -20,4 +20,31 @@ class Hexlet::MemberCLITest < MiniTest::Test
|
|
20
20
|
|
21
21
|
assert_requested stub
|
22
22
|
end
|
23
|
+
|
24
|
+
def test_fetch
|
25
|
+
stub = stub_request(:get, @router.api_member_lesson_backend_url("my_super", "exercise")).
|
26
|
+
to_return(:status => 200)
|
27
|
+
|
28
|
+
FakeFS do
|
29
|
+
result = Hexlet::MemberCLI.start ["fetch", "my_super", "exercise", "--verbose"]
|
30
|
+
assert { result }
|
31
|
+
end
|
32
|
+
|
33
|
+
assert_requested stub
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_submit
|
37
|
+
stub = stub_request(:post, @router.api_member_lesson_backend_results_url("my_super", "exercise")).
|
38
|
+
to_return(:status => 201)
|
39
|
+
Open3.stubs(:capture3).returns(["", "", 0])
|
40
|
+
|
41
|
+
FakeFS do
|
42
|
+
folder = "my_super_lesson/exercise"
|
43
|
+
FileUtils.mkdir_p(folder)
|
44
|
+
result = Hexlet::MemberCLI.start ["submit", folder, "--verbose"]
|
45
|
+
assert { result }
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_requested stub
|
49
|
+
end
|
23
50
|
end
|