diff --git a/spec/features/detects_private_method_spec.rb b/spec/features/detects_private_method_spec.rb new file mode 100644 index 0000000..c9e2357 --- /dev/null +++ b/spec/features/detects_private_method_spec.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require_relative '../../lib/lowkey' + +RSpec.describe 'Private method visibility' do + let(:file_path) { 'spec/fixtures/visibility_test.rb' } + let(:file_proxy) { Lowkey.load(file_path, cache: false) } + + it 'detects that a class has private methods' do + target_class = file_proxy["VisibilityTest"] + + expect(target_class.private_start_line).not_to be_nil + end +end diff --git a/spec/fixtures/visibility_test.rb b/spec/fixtures/visibility_test.rb new file mode 100644 index 0000000..50f6dfc --- /dev/null +++ b/spec/fixtures/visibility_test.rb @@ -0,0 +1,11 @@ +class VisibilityTest + def public_greet + "hello" + end + + private + + def private_greet + "hello" + end +end