Skip to content

Commit

Permalink
Merge pull request #59 from kelsin/ssl-version-fix
Browse files Browse the repository at this point in the history
Ssl version fix
  • Loading branch information
nickmerwin committed Oct 24, 2014
2 parents fe305be + 622059d commit 8590a52
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/coveralls/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.post_json(endpoint, hash)
Coveralls::Output.puts("#{ MultiJson.dump(hash, :pretty => true) }", :color => "green") if ENV['COVERALLS_DEBUG']
hash = apified_hash hash
Coveralls::Output.puts("[Coveralls] Submitting to #{API_BASE}", :color => "cyan")
response = RestClient.post(url, :json_file => hash_to_file(hash))
response = RestClient::Request.execute(:method => :post, :url => url, :payload => { :json_file => hash_to_file(hash) }, :ssl_version => 'SSLv23')
response_hash = MultiJson.load(response.to_str)
Coveralls::Output.puts("[Coveralls] #{ response_hash['message'] }", :color => "cyan")
if response_hash['message']
Expand Down
8 changes: 4 additions & 4 deletions spec/coveralls/coveralls_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

describe "#will_run?" do
it "checks CI environemnt variables" do
Coveralls.will_run?.should be_true
Coveralls.will_run?.should be_truthy
end

context "with CI disabled" do
Expand All @@ -28,7 +28,7 @@
end

it "indicates no run" do
Coveralls.will_run?.should be_false
Coveralls.will_run?.should be_falsy
end
end
end
Expand Down Expand Up @@ -61,7 +61,7 @@
end

it "uses default" do
::SimpleCov.should_receive(:start).with
::SimpleCov.should_receive(:start).with no_args
silence do
subject.wear!
end
Expand All @@ -87,7 +87,7 @@
silence do
result = subject.push!
end
result.should be_true
result.should be_truthy
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/coveralls/simplecov_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def source_fixture(filename)
it "posts json" do
result.files.should_not be_empty
silence do
Coveralls::SimpleCov::Formatter.new.format(result).should be_true
Coveralls::SimpleCov::Formatter.new.format(result).should be_truthy
end
end
end

context "should not run, noisy" do
it "only displays result" do
silence do
Coveralls::SimpleCov::Formatter.new.display_result(result).should be_true
Coveralls::SimpleCov::Formatter.new.display_result(result).should be_truthy
end
end
end
Expand All @@ -64,7 +64,7 @@ def source_fixture(filename)
it "rescues" do
e = RestClient::ResourceNotFound.new double('HTTP Response', :code => '502')
silence do
Coveralls::SimpleCov::Formatter.new.display_error(e).should be_false
Coveralls::SimpleCov::Formatter.new.display_error(e).should be_falsy
end
end
end
Expand Down
7 changes: 6 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ def setup_formatter
end

RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.include WebMock::API
config.expect_with :rspec do |c|
c.syntax = [:should, :expect]
end
config.mock_with :rspec do |c|
c.syntax = [:should, :expect]
end
config.after(:suite) do
WebMock.disable!
end
Expand Down

0 comments on commit 8590a52

Please sign in to comment.