Skip to content

Commit

Permalink
Changed the formatting of the log_warn output.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Apr 14, 2024
1 parent 551807f commit fed4c15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ronin/core/cli/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def log_info(message)
# The message to print.
#
def log_warn(message)
puts("#{colors.bold(colors.bright_yellow('***'))} #{colors.bold(colors.white(message))}")
puts("#{colors.bold(colors.bright_yellow('/!\\'))} #{colors.bold(colors.white(message))}")
end

#
Expand Down
8 changes: 4 additions & 4 deletions spec/cli/logging_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ class TestCommand < Ronin::Core::CLI::Command
context "when stdout is a TTY" do
before { allow(stdout).to receive(:tty?).and_return(true) }

it "must print '*** message' in bright-yellow and bold-white to stdout" do
it "must print '/!\\ message' in bright-yellow and bold-white to stdout" do
subject.log_warn(message)

expect(stdout.string).to eq(
"#{bold}#{bright_yellow}***#{reset_color}#{reset_intensity} #{bold}#{white}#{message}#{reset_color}#{reset_intensity}#{$/}"
"#{bold}#{bright_yellow}/!\\#{reset_color}#{reset_intensity} #{bold}#{white}#{message}#{reset_color}#{reset_intensity}#{$/}"
)
end
end

context "when stdout is not a TTY" do
it "must print '*** message' to stdout" do
it "must print '/!\\ message' to stdout" do
subject.log_warn(message)

expect(stdout.string).to eq("*** #{message}#{$/}")
expect(stdout.string).to eq("/!\\ #{message}#{$/}")
end
end
end
Expand Down

0 comments on commit fed4c15

Please sign in to comment.