Add shared examples

bug/bundler_fix
jvazquez-r7 2014-09-22 12:15:04 -05:00
parent a677749f5b
commit 45011ae87f
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
shared_examples_for "Rex::ImageSource::ImageSource" do
describe "#read_asciiz" do
let(:offset) { 0 }
it "returns an String" do
expect(subject.read_asciiz(offset)).to be_kind_of(String)
end
it "returns a null free String" do
expect(subject.read_asciiz(offset)).to_not include("\x00")
end
context "when offset bigger than available data" do
let(:offset) { 12345678 }
it "returns an empty String" do
expect(subject.read_asciiz(offset)).to be_empty
end
end
end
end