I don't think the visibility of `language` is what matters here, so no.

I stubbed `language` because it's the most direct dependency of the `ruby?` method. One alternative to using these two stubs would be to incorporate Linguist in the test like the following. However, that would turn this test from a unit test into more of an integration test.

```ruby
require 'linguist'
require 'active_support/core_ext/object/try'

# ...

describe ModifiedFile, '#ruby?' do
  context 'when file language is non-ruby' do
    it 'returns false for json' do
      json_file = double(:file, filename: 'app/models/user.json', status: 'not-removed')
      css_file = double(:file, filename: 'public/main.css.scss', status: 'not-removed')
      modified_file1 = ModifiedFile.new(json_file, double(:pull_request, file_contents: ''))
      modified_file2 = ModifiedFile.new(css_file, double(:pull_request, file_contents: ''))

      expect(modified_file1).not_to be_ruby
      expect(modified_file2).not_to be_ruby
    end
  end

  # ...
end
```

I think I'd prefer keeping this as a unit test, meaning we'd still have to stub `language` somehow. I'm open to suggestions, though.