Sha256: abf9dafe11d1e26a3949ead79ed70038fe109e33aa6484c6635984a5f4055c44

Contents?: true

Size: 770 Bytes

Versions: 2

Compression:

Stored size: 770 Bytes

Contents

require 'ronin/payloads/encoders/encoder'

require 'spec_helper'

describe Payloads::Encoders::Encoder do
  before(:all) do
    @encoder = Payloads::Encoders::Encoder.new(:name => 'test')
    @data = 'some data'
  end

  it "should require a name" do
    encoder = Payloads::Encoders::Encoder.new
    encoder.should_not be_valid

    encoder = Payloads::Encoders::Encoder.new(:name => 'encoder')
    encoder.should be_valid
  end

  it "should provide a #encode method" do
    @encoder.respond_to?(:encode).should == true
  end

  it "should return the data to be encoded by default" do
    @encoder.encode(@data).should == @data
  end

  it "should have a custom inspect method" do
    @encoder.inspect.should == '#<Ronin::Payloads::Encoders::Encoder: test>'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-exploits-0.3.1 spec/payloads/encoders/encoder_spec.rb
ronin-exploits-0.3.0 spec/payloads/encoders/encoder_spec.rb