Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions spec/features/detects_private_method_spec.rb
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions spec/fixtures/visibility_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class VisibilityTest
def public_greet
"hello"
end

private

def private_greet
"hello"
end
end