|
7 | 7 |
|
8 | 8 | describe "generate_mac" do
|
9 | 9 | it "generates simple addresses" do
|
10 |
| - is_expected.to run.with_params('02:00:00', 'example.com', 0).and_return('02:00:00:a3:79:a0') |
11 |
| - is_expected.to run.with_params('12-0f-00', 'example.com', 2).and_return('12:0f:00:a3:79:a2') |
| 10 | + is_expected.to run.with_params("02:00:00", "example.com").and_return("02:00:00:a3:79:a6") |
| 11 | + is_expected.to run.with_params("12-0f-00", "example.com", 2).and_return("12:0f:00:a3:79:a4") |
12 | 12 | end
|
13 | 13 | it "fails on invalid chars" do
|
14 |
| - is_expected.to run.with_params('g2:00:00', 'example.com', 0).and_raise_error(ArgumentError) |
| 14 | + is_expected.to run.with_params("g2:00:00", "example.com", 0).and_raise_error(ArgumentError) |
15 | 15 | end
|
16 | 16 | it "correctly masks final 3 bits" do
|
17 |
| - is_expected.to run.with_params('06 12 34', 'my.host.name', 0).and_return('06:12:34:3b:d9:98') |
18 |
| - is_expected.to run.with_params('5a.67.89', 'my.host.name', 3).and_return('5a:67:89:3b:d9:9b') |
19 |
| - is_expected.to run.with_params('AE:BC:DE', 'my.host.name', 7).and_return('ae:bc:de:3b:d9:9f') |
| 17 | + is_expected.to run.with_params("06 12 34", "my.host.name", 0).and_return("06:12:34:3b:d9:9a") |
| 18 | + is_expected.to run.with_params("5a.67.89", "my.host.name", 3).and_return("5a:67:89:3b:d9:99") |
| 19 | + is_expected.to run.with_params("AE:BC:DE", "my.host.name", 7).and_return("ae:bc:de:3b:d9:9d") |
20 | 20 | end
|
21 | 21 | it "fails on non-private oui" do
|
22 |
| - is_expected.to run.with_params('03:00:00', 'example.com', 0).and_raise_error(ArgumentError) |
| 22 | + is_expected.to run.with_params("03:00:00", "example.com", 0).and_raise_error(ArgumentError) |
23 | 23 | end
|
24 | 24 | it "fails on out of range index" do
|
25 |
| - is_expected.to run.with_params('02:00:00', 'example.com', 11).and_raise_error(ArgumentError) |
26 |
| - is_expected.to run.with_params('02:00:00', 'example.com', -1).and_raise_error(ArgumentError) |
| 25 | + is_expected.to run.with_params("02:00:00", "example.com", 11).and_raise_error(ArgumentError) |
| 26 | + is_expected.to run.with_params("02:00:00", "example.com", -1).and_raise_error(ArgumentError) |
27 | 27 | end
|
28 | 28 | end
|
29 |
| - |
0 commit comments