require 'ronin/model/targets_arch' require 'spec_helper' require 'model/models/targets_arch_model' describe Model::TargetsArch do it "should define an arch relation" do relationship = TargetsArchModel.relationships['arch'] relationship.should_not be_nil relationship.parent_model.should == Arch end it "should define a relationship with Arch" do relationship = Arch.relationships['targets_arch_models'] relationship.should_not be_nil relationship.child_model.should == TargetsArchModel end it "should provide access to the targeted arch" do model = TargetsArchModel.new(:arch => Arch.i386) model.arch.name.should == 'i386' end it "should allow the arch to be set via the getter method" do model = TargetsArchModel.new model.arch :i386 model.arch.name.should == 'i386' end end