mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
90de9b7f9e
commit
f0e5bcd597
2 changed files with 21 additions and 0 deletions
|
@ -92,4 +92,8 @@ module java::util::Collection
|
|||
duped.addAll(other)
|
||||
duped
|
||||
end
|
||||
|
||||
def inspect
|
||||
"<#{self.class.name}:#{self.hashCode} #{self.to_a(&:inspect)}>"
|
||||
end
|
||||
end
|
|
@ -82,6 +82,23 @@ describe "Java integration" do
|
|||
context "Java::JavaUtil::Collection" do
|
||||
subject{Java::JavaUtil::ArrayList.new(initial_array)}
|
||||
|
||||
context "when inspecting" do
|
||||
let(:items) { [:a, {:b => :c}] }
|
||||
subject { java.util.ArrayList.new(items) }
|
||||
|
||||
it "should include the contents of the Collection" do
|
||||
expect(subject.inspect).to include(items.inspect)
|
||||
end
|
||||
|
||||
it "should include the class name" do
|
||||
expect(subject.inspect).to include("ArrayList")
|
||||
end
|
||||
|
||||
it "should include the hash code of the collection" do
|
||||
expect(subject.inspect).to include(subject.hashCode.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
context "when deleting a unique instance" do
|
||||
let(:initial_array) {["foo", "bar"]}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue