Sha256: a9219fef563f445a92e3d34a3285752f016676659a8f5e1221ddcc2af17630d6
Contents?: true
Size: 1.98 KB
Versions: 2
Compression:
Stored size: 1.98 KB
Contents
require 'spec_helper' require 'ronin/exploits/metadata/arch' describe Ronin::Exploits::Metadata::Arch do module TestMetadataArch class WithNoArchSet include Ronin::Exploits::Metadata::Arch end class WithArchSet include Ronin::Exploits::Metadata::Arch arch :x86_64 end class InheritsItsArch < WithArchSet include Ronin::Exploits::Metadata::Arch end class OverridesItsInheritedArch < WithArchSet include Ronin::Exploits::Metadata::Arch arch :armbe end end describe ".arch" do subject { test_class } context "and when arch is not set in the class" do let(:test_class) { TestMetadataArch::WithNoArchSet } it "must default to nil" do expect(subject.arch).to be(nil) end end context "and when arch is set in the class" do let(:test_class) { TestMetadataArch::WithArchSet } it "must return the set arch" do expect(subject.arch).to eq(:x86_64) end end context "but when the arch was set in the superclass" do let(:test_class) { TestMetadataArch::InheritsItsArch } it "must return the arch set in the superclass" do expect(subject.arch).to eq(:x86_64) end context "but the arch is overridden in the sub-class" do let(:test_class) { TestMetadataArch::OverridesItsInheritedArch } it "must return the arch set in the sub-class" do expect(subject.arch).to eq(:armbe) end end end end describe "#arch" do subject { test_class.new } context "when the Exploit class has .arch set" do let(:test_class) { TestMetadataArch::WithArchSet } it "must return the Exploit class'es .arch" do expect(subject.arch).to eq(test_class.arch) end end context "when the Exploit class does not have .arch set" do let(:test_class) { TestMetadataArch::WithNoArchSet } it "must return nil" do expect(subject.arch).to be(nil) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ronin-exploits-1.0.0.beta2 | spec/metadata/arch_spec.rb |
ronin-exploits-1.0.0.beta1 | spec/metadata/arch_spec.rb |