Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Jan 9, 2021
1 parent 861b37a commit 9f94cf7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 8 additions & 0 deletions spec/coveralls/coveralls_spec.rb
Expand Up @@ -80,6 +80,14 @@
end

describe '#push!' do
let(:coverage_hash) do
{ 'file.rb'=>{ 'lines'=>[nil] } }
end

before do
allow(SimpleCov::ResultMerger).to receive(:merge_valid_results).and_return([['RSpec'], coverage_hash])
end

it 'sends existing test results' do
result = false
silence do
Expand Down
11 changes: 2 additions & 9 deletions spec/spec_helper.rb
Expand Up @@ -49,15 +49,8 @@ def setup_formatter

def stub_api_post
body = '{"message":"","url":""}'
stub_request(:post, "#{Coveralls::API::API_BASE}/jobs").with(
headers: {
'Accept' => '*/*; q=0.5, application/xml',
'Accept-Encoding' => 'gzip, deflate',
'Content-Length' => /.+/,
'Content-Type' => /.+/,
'User-Agent' => 'Ruby'
}
).to_return(status: 200, body: body, headers: {})
stub_request(:post, "#{Coveralls::API::API_BASE}/jobs")
.to_return(status: 200, body: body, headers: {})
end

def silence(&block)
Expand Down

0 comments on commit 9f94cf7

Please sign in to comment.