Skip to content

Commit

Permalink
Fix encoding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Claudius committed May 1, 2016
1 parent a240074 commit 60b80b8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions spec/arp_spec.rb
Expand Up @@ -181,6 +181,7 @@
before :each do
@arp_packet = ARPPacket.new
@temp_file = Tempfile.new('arp_pcap')
@temp_file.force_encoding('binary')
end

after(:each) { @temp_file.close; @temp_file.unlink }
Expand Down
5 changes: 4 additions & 1 deletion spec/eth_spec.rb
Expand Up @@ -115,7 +115,10 @@
end

context "when reading/writing PCAP to file" do
before(:each) { @temp_file = Tempfile.new('arp_pcap') }
before(:each) {
@temp_file = Tempfile.new('arp_pcap')
@temp_file.force_encoding('binary')
}
after(:each) { @temp_file.close; @temp_file.unlink }


Expand Down
1 change: 1 addition & 0 deletions spec/icmp_spec.rb
Expand Up @@ -74,6 +74,7 @@
before :each do
@icmp_packet = ICMPPacket.new
@temp_file = Tempfile.new('icmp_pcap')
@temp_file.force_encoding('binary')
end

after(:each) { @temp_file.close; @temp_file.unlink }
Expand Down
5 changes: 4 additions & 1 deletion spec/pcap_spec.rb
Expand Up @@ -268,7 +268,10 @@
end

context "when writing" do
before(:each) { @temp_file = Tempfile.new('write_pcap') }
before(:each) {
@temp_file = Tempfile.new('write_pcap')
@temp_file.force_encoding("binary")
}
after(:each) { @temp_file.close; @temp_file.unlink }

it "should read from a string" do
Expand Down

0 comments on commit 60b80b8

Please sign in to comment.