require 'ronin/model/targets_os' require 'spec_helper' require 'model/models/targets_os_model' describe Model::TargetsOS do it "should define an os relation" do relationship = TargetsOSModel.relationships['os'] relationship.should_not be_nil relationship.parent_model.should == OS end it "should define a relationship with Arch" do relationship = OS.relationships['targets_os_models'] relationship.should_not be_nil relationship.child_model.should == TargetsOSModel end it "should provide access to the targeted os" do model = TargetsOSModel.new(:os => OS.linux('2.6.29')) model.os.should == OS.linux('2.6.29') end it "should allow the os to be set via the getter method" do model = TargetsOSModel.new model.os :name => 'Linux', :version => '2.6.29' model.os.name.should == 'Linux' model.os.version.should == '2.6.29' end end