Bug: require ActiveSupport core_ext blank (#520)
This commit is contained in:
parent
e9ee9556ce
commit
6ad5aa106d
|
@ -5,6 +5,7 @@ require "octokit"
|
||||||
require "faraday-http-cache"
|
require "faraday-http-cache"
|
||||||
require "logger"
|
require "logger"
|
||||||
require "active_support"
|
require "active_support"
|
||||||
|
require "active_support/core_ext/object/blank"
|
||||||
require "json"
|
require "json"
|
||||||
require "multi_json"
|
require "multi_json"
|
||||||
require "benchmark"
|
require "benchmark"
|
||||||
|
|
|
@ -36,16 +36,17 @@ module GitHubChangelogGenerator
|
||||||
detect_actual_closed_dates(@issues + @pull_requests)
|
detect_actual_closed_dates(@issues + @pull_requests)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Encapsulate characters to make markdown look as expected.
|
ENCAPSULATED_CHARACTERS = %w(< > * _ \( \) [ ] #)
|
||||||
|
|
||||||
|
# Encapsulate characters to make Markdown look as expected.
|
||||||
#
|
#
|
||||||
# @param [String] string
|
# @param [String] string
|
||||||
# @return [String] encapsulated input string
|
# @return [String] encapsulated input string
|
||||||
def encapsulate_string(string)
|
def encapsulate_string(string)
|
||||||
string.gsub! '\\', '\\\\'
|
string = string.gsub('\\', '\\\\')
|
||||||
|
|
||||||
encpas_chars = %w(< > * _ \( \) [ ] #)
|
ENCAPSULATED_CHARACTERS.each do |char|
|
||||||
encpas_chars.each do |char|
|
string = string.gsub(char, "\\#{char}")
|
||||||
string.gsub! char, "\\#{char}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
string
|
string
|
||||||
|
|
17
spec/unit/generator/generator_generation_spec.rb
Normal file
17
spec/unit/generator/generator_generation_spec.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module GitHubChangelogGenerator
|
||||||
|
describe Generator do
|
||||||
|
describe "#get_string_for_issue" do
|
||||||
|
let(:issue) do
|
||||||
|
{ "title" => "Bug in code" }
|
||||||
|
end
|
||||||
|
|
||||||
|
it "formats an issue according to options" do
|
||||||
|
expect do
|
||||||
|
described_class.new.get_string_for_issue(issue)
|
||||||
|
end.not_to raise_error
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user