Sha256: af019b524c9b36493642f8b6718bb21dfa21ed6e4a18e4c588c93653521ab9a1
Contents?: true
Size: 1.78 KB
Versions: 8
Compression:
Stored size: 1.78 KB
Contents
require 'spec_helper' require 'ronin/arch' describe Arch do it "should require a name, endian and address_length attributes" do arch = Arch.new arch.should_not be_valid arch.name = 'future' arch.should_not be_valid arch.endian = 'little' arch.should_not be_valid arch.address_length = 4 arch.should be_valid end it "should require a unique name" do first_arch = Arch.create(:name => 'cats', :endian => 'little', :address_length => 4) first_arch.should be_valid second_arch = Arch.new(:name => 'cats', :endian => 'big', :address_length => 4) second_arch.should_not be_valid end it "should require either 'little' or 'big' for the endian attribute" do arch = Arch.new(:name => 'test', :endian => 'lol', :address_length => 4) arch.should_not be_valid arch.endian = 'little' arch.should be_valid arch.endian = 'big' arch.should be_valid end it "should require a numeric valid for the address_length attribute" do arch = Arch.new(:name => 'test2', :endian => 'big', :address_length => 'x') arch.should_not be_valid arch.address_length = '4' arch.should be_valid arch.address_length = 4 arch.should be_valid end it "should provide built-in archs" do Arch.i386.should_not be_nil end it "should allow custom names for built-in archs" do Arch.x86_64.name.should == 'x86-64' end it "should implicitly splat the endian and address length" do endian, address_length = Arch.x86 endian.should == Arch.x86.endian address_length.should == Arch.x86.address_length end end
Version data entries
8 entries across 8 versions & 1 rubygems