kanrisuru 0.8.19 → 0.8.20

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
  SHA256:
3
- metadata.gz: 90fafd703817d1e16744262817dd0b5e5a51ea942f2853b154f4bd2746295fd7
4
- data.tar.gz: 0e0b35e325d3237faacbb71f22873b1c661495af0d93830e7ad91babbb060b3c
3
+ metadata.gz: '0969518ec2898fe5ceaa74c897cdb0df384541d8cd8cd51e311e7f4915ce4155'
4
+ data.tar.gz: b57d0acd7d23116f2bf6934feaa77d83f007eede49a48f93efb47a241baf0434
5
5
  SHA512:
6
- metadata.gz: 76e116b83a5c119c0672b8ec5f1bac8f23307e1e06d3b393804df912f6110faf63527ca126ed4eb164d6ba58ef4ba92f3d1c3e15b252dc703058e39fc3ab4ba3
7
- data.tar.gz: 8e80e6457fd848d4dee5a31e33881c91458402df16cc82845b6300afc2543fe583fe48aeb2914e4329de9d9a668b6afbc2dd533d56886bd6fe0656ede58e5c95
6
+ metadata.gz: de82086f075e8deb1fcec6b8ca3205c384192a3dcf9a24d5852a75dcbaf1127e65c2121cc247cc64ac86647735447bfb3e5065f1aa808f0d0f279cf34e6ec3bd
7
+ data.tar.gz: e6944d4a4727ced09f581e10e5a55aba3f32147fc65d5ffa7857cbfa73e4e448b0ecaacaadd0bb332cf572f17771f7225ea74dcd2ada656ff10f8320f5e09a81
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## Kanrisuru 0.8.20 (November 13, 2021)
2
+ * Unstub network requests for full rspec test-suite run
3
+
1
4
  ## Kanrisuru 0.8.19 (October 31, 2021)
2
5
  * Add functional test cases for `ss` command.
3
6
  * Enforce contraints on `family` parameter for `ss` command.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.8.19'
4
+ VERSION = '0.8.20'
5
5
  end
@@ -2,9 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- StubNetwork.stub!
6
-
7
5
  RSpec.describe Kanrisuru::Core::Find do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
8
14
  let(:host) do
9
15
  Kanrisuru::Remote::Host.new(
10
16
  host: 'localhost',
@@ -2,9 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- StubNetwork.stub!
6
-
7
5
  RSpec.describe Kanrisuru::Core::Path do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
8
14
  let(:host) do
9
15
  Kanrisuru::Remote::Host.new(
10
16
  host: 'localhost',
@@ -2,9 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- StubNetwork.stub!
6
-
7
5
  RSpec.describe Kanrisuru::Core::Socket do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
8
14
  let(:host) do
9
15
  Kanrisuru::Remote::Host.new(
10
16
  host: 'localhost',
@@ -2,9 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- StubNetwork.stub!
6
-
7
5
  RSpec.describe Kanrisuru::Core::Stat do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
8
14
  let(:host) do
9
15
  Kanrisuru::Remote::Host.new(
10
16
  host: 'localhost',
@@ -2,9 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- StubNetwork.stub!
6
-
7
5
  RSpec.describe Kanrisuru::Core::Stream do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
8
14
  let(:host) do
9
15
  Kanrisuru::Remote::Host.new(
10
16
  host: 'localhost',
@@ -2,9 +2,15 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- StubNetwork.stub!
6
-
7
5
  RSpec.describe Kanrisuru::Core::Stat do
6
+ before(:all) do
7
+ StubNetwork.stub!
8
+ end
9
+
10
+ after(:all) do
11
+ StubNetwork.unstub!
12
+ end
13
+
8
14
  let(:host) do
9
15
  Kanrisuru::Remote::Host.new(
10
16
  host: 'localhost',
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  def expect_command(result, string)
4
- puts result.command.raw_command
4
+ # puts result.command.raw_command
5
5
  expect(result.command.raw_command).to eq(
6
6
  string
7
7
  )
@@ -3,41 +3,61 @@
3
3
  class StubNetwork
4
4
  class << self
5
5
  def stub!
6
- ## Stub out the execute_with_retries method to
7
- ## test functionality of host commands
8
- Kanrisuru::Remote::Host.class_eval do
9
- private
10
-
11
- def execute_with_retries(command)
12
- command.handle_status(0)
13
- command.handle_data(nil)
6
+ unless Kanrisuru::Remote::Host.instance_methods(false).include?(:execute_with_retries_alias)
7
+ Kanrisuru::Remote::Host.class_eval do
8
+ alias_method :execute_with_retries_alias, :execute_with_retries
9
+ def execute_with_retries(command)
10
+ command.handle_status(0)
11
+ command.handle_data(nil)
14
12
 
15
- command
13
+ command
14
+ end
16
15
  end
17
16
  end
18
17
 
19
- Kanrisuru::Remote::Os.class_eval do
20
- def initialize(host)
21
- @host = host
22
-
23
- @kernel_name = 'Linux'
24
- @kernel_version = '#91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021'
25
- @operating_system = 'GNU/Linux'
26
- @hardware_platform = 'x86_64'
27
- @processor = 'x86_64'
28
- @release = 'ubuntu'
29
- @version = 20.0
18
+ unless Kanrisuru::Remote::Os.instance_methods(false).include?(:initialize_alias)
19
+ Kanrisuru::Remote::Os.class_eval do
20
+ alias_method :initialize_alias, :initialize
21
+ def initialize(host)
22
+ @host = host
23
+
24
+ @kernel_name = 'Linux'
25
+ @kernel_version = '#91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021'
26
+ @operating_system = 'GNU/Linux'
27
+ @hardware_platform = 'x86_64'
28
+ @processor = 'x86_64'
29
+ @release = 'ubuntu'
30
+ @version = 20.0
31
+ end
30
32
  end
31
33
  end
32
34
 
33
- Kanrisuru::Result.class_eval do
34
- def initialize(command)
35
- @command = command
36
- @data = nil
35
+ unless Kanrisuru::Result.instance_methods(false).include?(:initialize_alias)
36
+ Kanrisuru::Result.class_eval do
37
+ alias_method :initialize_alias, :initialize
38
+ def initialize(command)
39
+ @command = command
40
+ @data = nil
37
41
 
38
- @error = @command.to_a if @command.failure?
42
+ @error = @command.to_a if @command.failure?
43
+ end
39
44
  end
40
45
  end
41
46
  end
47
+
48
+ def unstub!
49
+ Kanrisuru::Remote::Host.class_eval do
50
+ alias_method :execute_with_retries, :execute_with_retries_alias
51
+ end
52
+
53
+ Kanrisuru::Remote::Os.class_eval do
54
+ alias_method :initialize, :initialize_alias
55
+ end
56
+
57
+ Kanrisuru::Result.class_eval do
58
+ alias_method :initialize, :initialize_alias
59
+ end
60
+ end
61
+
42
62
  end
43
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.19
4
+ version: 0.8.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-31 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec