require 'ronin/model/has_default_port' require 'spec_helper' require 'model/models/default_port_model' require 'model/models/non_default_port_model' describe Model::HasDefaultPort do it "should define a default_port property" do end it "should initialize the default_port property if DEFAULT_PORT is defined" do model = DefaultPortModel.new model.default_port.should == DefaultPortModel::DEFAULT_PORT end it "should not initialize the default_port property if DEFAULT_PORT is undefined" do model = NonDefaultPortModel.new model.default_port.should be_nil end it "should allow default_port to be overridden" do model = DefaultPortModel.new(:default_port => 70) model.default_port.should == 70 end end