spec/formatting/binary/array_spec.rb in ronin-support-0.5.0 vs spec/formatting/binary/array_spec.rb in ronin-support-0.5.1

- old
+ new

@@ -9,14 +9,18 @@ end describe "#pack" do let(:packed) { "\x34\x12hello\0" } - it "should pack elements using Array#pack codes" do - subject.pack('vZ*').should == packed + context "when only given a String" do + it "should pack elements using Array#pack codes" do + subject.pack('vZ*').should == packed + end end - it "should pack elements using Binary::Template types" do - subject.pack(:uint16_le, :string).should == packed + context "otherwise" do + it "should pack fields using Binary::Template" do + subject.pack(:uint16_le, :string).should == packed + end end end end