Skip to content

Commit

Permalink
Some polishing in the AnsiString test
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Jun 17, 2015
1 parent e41d3dd commit 5cad6e3
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/ruby/ansi_string.rb
Expand Up @@ -6,15 +6,15 @@

describe Yast::CoreExt::AnsiString do
describe "#remove_ansi_sequences" do
let(:string) {
file = File.join(File.dirname(__FILE__), "data", filename)
File.open(file, "rb").read
}
let(:result) { " Cyan Bold\n Pink Normal\n" }

context "using the AnsiString refinement" do
using Yast::CoreExt::AnsiString

let(:string) {
file = File.join(File.dirname(__FILE__), "data", filename)
File.open(file, "rb").read
}
let(:result) { " Cyan Bold\n Pink Normal\n" }

context "when the string contains colors" do
let(:filename) { "ansi_colors.txt" }

Expand Down Expand Up @@ -62,10 +62,8 @@
end

context "using the AnsiString refinement" do
let(:string) { "whatever" }

it "is not defined" do
expect { string.remove_ansi_sequences }
expect { "a string".remove_ansi_sequences }
.to raise_error(NoMethodError, /remove_ansi_sequences/)
end
end
Expand Down

0 comments on commit 5cad6e3

Please sign in to comment.