Skip to content

Commit

Permalink
Change to exclude from windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Jul 25, 2019
1 parent d9c871a commit 261785d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/unit/binary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
expect(TTY::File.binary?(file)).to eq(false)
end

it "indentifies a file as non-binary when greater than 4096 bytes with unicode chars" do
it "indentifies a file as non-binary when greater than 4096 bytes with unicode chars", unless: RSpec::Support::OS.windows? do
file = tmp_pathname("binary", "unicode.txt")

expect(TTY::File.binary?(file)).to eq(false)
Expand Down
14 changes: 13 additions & 1 deletion spec/unit/read_to_char_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# frozen_string_literal: true

RSpec.describe TTY::File, "#read_to_char" do
it "reads file up to valid char" do
before do
@saved_verbosity = $VERBOSE
@saved_encoding = Encoding.default_external
$VERBOSE = nil
Encoding.default_external = Encoding::UTF_8
end

after do
Encoding.default_external = @saved_encoding
$VERBOSE = @saved_verbosity
end

it "reads file up to valid char", unless: RSpec::Support::OS.windows? do
file = tmp_pathname("binary", "unicode.txt")
bytes = 4096

Expand Down

0 comments on commit 261785d

Please sign in to comment.