code_analyzer 0.4.8 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/main.yml +31 -0
- data/.ruby-version +1 -0
- data/README.md +1 -7
- data/code_analyzer.gemspec +2 -1
- data/lib/code_analyzer/analyzer_exception.rb +2 -1
- data/lib/code_analyzer/checker.rb +5 -8
- data/lib/code_analyzer/checking_visitor/base.rb +3 -2
- data/lib/code_analyzer/checking_visitor/default.rb +9 -12
- data/lib/code_analyzer/checking_visitor/plain.rb +3 -4
- data/lib/code_analyzer/checking_visitor.rb +5 -4
- data/lib/code_analyzer/nil.rb +2 -1
- data/lib/code_analyzer/sexp.rb +132 -111
- data/lib/code_analyzer/version.rb +3 -2
- data/lib/code_analyzer/warning.rb +3 -2
- data/lib/code_analyzer.rb +10 -9
- data/spec/code_analyzer/checker_spec.rb +19 -17
- data/spec/code_analyzer/checking_visitor/base_spec.rb +2 -0
- data/spec/code_analyzer/checking_visitor/default_spec.rb +14 -12
- data/spec/code_analyzer/checking_visitor/plain_spec.rb +6 -4
- data/spec/code_analyzer/nil_spec.rb +12 -10
- data/spec/code_analyzer/sexp_spec.rb +469 -339
- data/spec/code_analyzer/warning_spec.rb +6 -6
- data/spec/spec_helper.rb +3 -1
- metadata +8 -8
- data/.travis.yml +0 -5
@@ -1,35 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
module CodeAnalyzer
|
4
6
|
describe Nil do
|
5
7
|
let(:core_nil) { Nil.new }
|
6
8
|
|
7
|
-
context
|
8
|
-
it
|
9
|
+
context 'to_s' do
|
10
|
+
it 'should return self' do
|
9
11
|
expect(core_nil.to_s).to eq core_nil
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
13
|
-
context
|
14
|
-
it
|
15
|
+
context 'hash_size' do
|
16
|
+
it 'should return 0' do
|
15
17
|
expect(core_nil.hash_size).to eq 0
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
|
-
context
|
20
|
-
it
|
21
|
+
context 'method_missing' do
|
22
|
+
it 'should return self' do
|
21
23
|
expect(core_nil.undefined).to eq core_nil
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
context
|
26
|
-
it
|
27
|
+
context 'present?' do
|
28
|
+
it 'should return false' do
|
27
29
|
expect(core_nil).not_to be_present
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
|
-
context
|
32
|
-
it
|
33
|
+
context 'blank?' do
|
34
|
+
it 'should return true' do
|
33
35
|
expect(core_nil).to be_blank
|
34
36
|
end
|
35
37
|
end
|