|
5 | 5 |
|
6 | 6 | describe Rex::Oui do
|
7 | 7 | describe ".lookup_oui_fullname" do
|
8 |
| - subject { described_class.lookup_oui_fullname(mac) } |
| 8 | + subject(:oui_fullname) { described_class.lookup_oui_fullname(mac) } |
9 | 9 |
|
10 | 10 | context "when valid mac for OUI with name" do
|
11 | 11 | let(:mac) { '000011' }
|
|
28 | 28 | context "when invalid mac format" do
|
29 | 29 | let(:mac) { 'invalid' }
|
30 | 30 | it "raises an error" do
|
31 |
| - expect { subject }.to raise_error |
| 31 | + expect { oui_fullname }.to raise_error |
32 | 32 | end
|
33 | 33 | end
|
34 | 34 | end
|
35 | 35 |
|
36 | 36 | describe ".lookup_oui_company_name" do
|
37 |
| - subject { described_class.lookup_oui_company_name(mac) } |
| 37 | + subject(:oui_company_name) { described_class.lookup_oui_company_name(mac) } |
38 | 38 |
|
39 | 39 | context "when valid mac for OUI with name" do
|
40 | 40 | let(:mac) { '000011' }
|
|
57 | 57 | context "when invalid mac format" do
|
58 | 58 | let(:mac) { 'invalid' }
|
59 | 59 | it "raises an error" do
|
60 |
| - expect { subject }.to raise_error |
| 60 | + expect { oui_company_name }.to raise_error |
61 | 61 | end
|
62 | 62 | end
|
63 | 63 | end
|
64 | 64 |
|
65 | 65 | describe ".check_mac" do
|
66 | 66 | context "when valid mac" do
|
67 |
| - it "returns nil" do |
68 |
| - expect(described_class.check_mac('AA:BB:CC')).to be_nil |
69 |
| - expect(described_class.check_mac('AABBCC')).to be_nil |
70 |
| - expect(described_class.check_mac('AA:BB:CC:DD')).to be_nil |
71 |
| - expect(described_class.check_mac('AABBCCDD')).to be_nil |
72 |
| - expect(described_class.check_mac('AA:BB:CC:DD:EE')).to be_nil |
73 |
| - expect(described_class.check_mac('AABBCCDDEE')).to be_nil |
74 |
| - expect(described_class.check_mac('AA:BB:CC:DD:EE:FF')).to be_nil |
75 |
| - expect(described_class.check_mac('AABBCCDDEEFF')).to be_nil |
76 |
| - end |
| 67 | + it { expect(described_class.check_mac('AA:BB:CC')).to be_nil } |
| 68 | + it { expect(described_class.check_mac('AABBCC')).to be_nil } |
| 69 | + it { expect(described_class.check_mac('AA:BB:CC:DD')).to be_nil } |
| 70 | + it { expect(described_class.check_mac('AABBCCDD')).to be_nil } |
| 71 | + it { expect(described_class.check_mac('AA:BB:CC:DD:EE')).to be_nil } |
| 72 | + it { expect(described_class.check_mac('AABBCCDDEE')).to be_nil } |
| 73 | + it { expect(described_class.check_mac('AA:BB:CC:DD:EE:FF')).to be_nil } |
| 74 | + it { expect(described_class.check_mac('AABBCCDDEEFF')).to be_nil } |
77 | 75 | end
|
78 | 76 |
|
79 | 77 | context "when invalid mac" do
|
80 |
| - it "raises an error" do |
81 |
| - expect { described_class.check_mac('AA') }.to raise_error |
82 |
| - expect { described_class.check_mac('AA:BB:CC:DD:JJ') }.to raise_error |
83 |
| - expect { described_class.check_mac('AA:BB') }.to raise_error |
84 |
| - expect { described_class.check_mac('AABB') }.to raise_error |
85 |
| - expect { described_class.check_mac('AA:BB:CC:DD:EE:FF:AA') }.to raise_error |
86 |
| - expect { described_class.check_mac('AABBCCDDEEFFAA') }.to raise_error |
87 |
| - end |
| 78 | + it { expect { described_class.check_mac('AA') }.to raise_error } |
| 79 | + it { expect { described_class.check_mac('AA:BB:CC:DD:JJ') }.to raise_error } |
| 80 | + it { expect { described_class.check_mac('AA:BB') }.to raise_error } |
| 81 | + it { expect { described_class.check_mac('AABB') }.to raise_error } |
| 82 | + it { expect { described_class.check_mac('AA:BB:CC:DD:EE:FF:AA') }.to raise_error } |
| 83 | + it { expect { described_class.check_mac('AABBCCDDEEFFAA') }.to raise_error } |
88 | 84 | end
|
89 | 85 | end
|
90 | 86 | end
|
0 commit comments