Skip to content

Commit

Permalink
Skip NotImplementedError exceptions caused by JRuby lack of "%a" supp…
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Jun 12, 2021
1 parent b1b53c4 commit 8d2e235
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions spec/numeric/base/hexadecimal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,23 @@ def initialize
let(:type) { Hexdump::Type::Float32.new }

it "must set #width to 20 + 1" do
expect(subject.width).to eq(20 + 1)
begin
expect(subject.width).to eq(20 + 1)
rescue NotImplementedError => error
skip error.message
end
end
end

context "and the type size is 8" do
let(:type) { Hexdump::Type::Float64.new }

it "must set #width to 20 + 1" do
expect(subject.width).to eq(20 + 1)
begin
expect(subject.width).to eq(20 + 1)
rescue NotImplementedError => error
skip error.message
end
end
end
end
Expand Down Expand Up @@ -265,13 +273,21 @@ def initialize

context "and the value is positive" do
it "must return a hexadecimal string of length 20 prefixed with a ' '" do
expect(subject % value).to eq(" #{hex}")
begin
expect(subject % value).to eq(" #{hex}")
rescue NotImplementedError => error
skip error.message
end
end
end

context "and the value is negative" do
it "must return a hexadecimal string of length 20 prefixed with a '-'" do
expect(subject % -value).to eq("-#{hex}")
begin
expect(subject % -value).to eq("-#{hex}")
rescue NotImplementedError => error
skip error.message
end
end
end
end
Expand All @@ -281,13 +297,21 @@ def initialize

context "and the value is positive" do
it "must return a hexadecimal string of length 20 prefixed with a ' '" do
expect(subject % value).to eq(" #{hex}")
begin
expect(subject % value).to eq(" #{hex}")
rescue NotImplementedError => error
skip error.message
end
end
end

context "and the value is negative" do
it "must return a hexadecimal string of length 20 prefixed with a '-'" do
expect(subject % -value).to eq("-#{hex}")
begin
expect(subject % -value).to eq("-#{hex}")
rescue NotImplementedError => error
skip error.message
end
end
end
end
Expand Down

0 comments on commit 8d2e235

Please sign in to comment.