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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 923d541f087c81d072c5d11448148a1d101014ac
4
- data.tar.gz: 5549df3113f39f9658c5cccddcbb3c455b3fef34
3
+ metadata.gz: 2d33a80460e2a9cf965e5dd657f54b1df6bee58e
4
+ data.tar.gz: c6e11a928c0c0281fb7e8e833ed111ea0a6cb3b0
5
5
  SHA512:
6
- metadata.gz: 8de462597b0fa5684b7043b454b0dd1771e845533b070ce708de9ffb73134b1044538a9a2383722b752ffd369383e39a196ea7ffbf7baf34cb4a562e7f2bc8b4
7
- data.tar.gz: 99de90f5ec5b442d21effa17e2bbe6ca4b51f7565338942ba5904b3458065a13de647ed21d50f6d570fbf993ea1c571feca5ff0cc052f1694179cd0253ca04dd
6
+ metadata.gz: 44b3036817aa7dc72bfd7317bc1ccf3698d05c9a8f647e839a93148e2802e67712760dd1242965eaf6edef7a4cb8ffcb0c4e796da386a847db45dcd5f91e7ae0
7
+ data.tar.gz: ba0e2f32cf61b18f967277d5f9e5fdd93a153c6458e19f199557fab25fed02ee6b3893e9a3908f9691bbc29d20af4b783fb789c02ecd02bbe79aa45f52e41169
@@ -12,7 +12,6 @@ require 'rake'
12
12
  require 'thor'
13
13
  require 'rest-client'
14
14
  require 'i18n'
15
- require 'childprocess'
16
15
 
17
16
  I18n.available_locales = [:en]
18
17
  I18n.enforce_available_locales = true
@@ -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
- tgz = Zlib::GzipReader.new(File.open(tarball_path, 'rb'))
48
- Archive::Tar::Minitar.unpack(tgz, exercise_path)
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
 
@@ -1,3 +1,3 @@
1
1
  module Hexlet
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,5 +1,9 @@
1
1
  en:
2
2
  membercli:
3
+ submit:
4
+ created: exercise result has been sent
5
+ fetch:
6
+ ok: exercise has been downloaded
3
7
  login:
4
8
  ok: login has been succesfull
5
9
  not_found: User has not been found
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexlet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Mokevnin