1
- require 'junoser/squash'
1
+ require 'pathname'
2
+
3
+ $: << File . expand_path ( '../' , Pathname . new ( __FILE__ ) . realpath )
2
4
require 'helper'
3
5
6
+ $: << File . expand_path ( '../../lib' , Pathname . new ( __FILE__ ) . realpath )
7
+ require 'junoser/squash'
8
+
9
+
4
10
class TestCommentLine < Test ::Unit ::TestCase
5
11
config_subcommand = <<-EOS
6
12
set interfaces em0 unit 0 family inet address 192.0.2.1/32
@@ -26,19 +32,17 @@ class TestCommentLine < Test::Unit::TestCase
26
32
# config_squash
27
33
28
34
test 'check subcommand function' do
29
- assert_equal ( <<-EOS , Junoser ::Squash . new ( config_subcommand ) . transform )
30
- set interfaces em0 unit 0 family inet address 192.0.2.1/32
35
+ assert_equal ( 'set interfaces em0 unit 0 family inet address 192.0.2.1/32
31
36
set interfaces em100 unit 0 family inet
32
- set interfaces em100 unit 0 family inet address 192.0.2.1/32
33
- EOS
37
+ set interfaces em100 unit 0 family inet address 192.0.2.1/32' , Junoser :: Squash . new ( config_subcommand ) . transform )
38
+
34
39
end
35
40
36
41
test 'check delete function' do
37
- assert_equal ( <<-EOS , Junoser ::Squash . new ( config_delete ) . transform )
38
- set interfaces em0 unit 0 family inet address 192.0.2.0/32
42
+ assert_equal ( 'set interfaces em0 unit 0 family inet address 192.0.2.0/32
39
43
set interfaces em10
40
44
set interfaces em10 unit 20
41
- set interfaces em100 unit 100 family inet address 192.0.2.0/32
42
- EOS
45
+ set interfaces em100 unit 100 family inet address 192.0.2.0/32' , Junoser :: Squash . new ( config_delete ) . transform )
46
+
43
47
end
44
48
end
0 commit comments