spec/trema/dsl/vhost_spec.rb in trema-0.4.6 vs spec/trema/dsl/vhost_spec.rb in trema-0.4.7
- old
+ new
@@ -14,123 +14,123 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-require File.join( File.dirname( __FILE__ ), "..", "..", "spec_helper" )
-require "trema/dsl/vhost"
+require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
+require 'trema/dsl/vhost'
module Trema
module DSL
describe Vhost do
describe :name do
- context "when name empty" do
+ context 'when name empty' do
before { @vhost = Vhost.new }
- subject { @vhost[ :name ] }
+ subject { @vhost[ :name] }
- context "and IP address empty" do
+ context 'and IP address empty' do
it { should be_nil }
end
- context "and IP address is 192.168.100.100" do
- before { @vhost.ip "192.168.100.100" }
+ context 'and IP address is 192.168.100.100' do
+ before { @vhost.ip '192.168.100.100' }
- specify { should == "192.168.100.100" }
+ specify { should == '192.168.100.100' }
end
end
context "when name is \"Yutaro's host\"" do
- before { @vhost = Vhost.new( "Yutaro's host" ) }
+ before { @vhost = Vhost.new("Yutaro's host") }
- subject { @vhost[ :name ] }
+ subject { @vhost[ :name] }
- context "and ip address empty" do
+ context 'and ip address empty' do
it { should == "Yutaro's host" }
end
- context "and ip address 192.168.100.100" do
- before { @vhost.ip "192.168.100.100" }
+ context 'and ip address 192.168.100.100' do
+ before { @vhost.ip '192.168.100.100' }
it { should == "Yutaro's host" }
end
end
end
describe :promisc do
- before { @vhost = Vhost.new( "Yutaro's host" ) }
+ before { @vhost = Vhost.new("Yutaro's host") }
- subject { @vhost[ :promisc ] }
+ subject { @vhost[ :promisc] }
- context "when promisc off" do
- before { @vhost.promisc "off" }
+ context 'when promisc off' do
+ before { @vhost.promisc 'off' }
it { should be_false }
end
- context "when promisc no" do
- before { @vhost.promisc "no" }
+ context 'when promisc no' do
+ before { @vhost.promisc 'no' }
it { should be_false }
end
- context "when promisc on" do
- before { @vhost.promisc "on" }
+ context 'when promisc on' do
+ before { @vhost.promisc 'on' }
it { should be_true }
end
- context "when promisc yes" do
- before { @vhost.promisc "yes" }
+ context 'when promisc yes' do
+ before { @vhost.promisc 'yes' }
it { should be_true }
end
- context "when promisc INVALID_VALUE" do
+ context 'when promisc INVALID_VALUE' do
specify do
- expect { @vhost.promisc "INVALID_VALUE" }.to raise_error( Trema::DSL::SyntaxError )
+ expect { @vhost.promisc 'INVALID_VALUE' }.to raise_error(Trema::DSL::SyntaxError)
end
end
end
describe :netmask do
- before { @vhost = Vhost.new( "Yutaro's host" ) }
+ before { @vhost = Vhost.new("Yutaro's host") }
- subject { @vhost[ :netmask ] }
+ subject { @vhost[ :netmask] }
- context "when netmask empty" do
+ context 'when netmask empty' do
it { should be_nil }
end
- context "when netmask is 255.255.255.0" do
- before { @vhost.netmask "255.255.255.0" }
+ context 'when netmask is 255.255.255.0' do
+ before { @vhost.netmask '255.255.255.0' }
- it { should == "255.255.255.0" }
+ it { should == '255.255.255.0' }
end
end
describe :mac do
- before { @vhost = Vhost.new( "Yutaro's host" ) }
+ before { @vhost = Vhost.new("Yutaro's host") }
- subject { @vhost[ :mac ] }
+ subject { @vhost[ :mac] }
- context "when mac empty" do
+ context 'when mac empty' do
it { should be_nil }
end
- context "when mac is 00:00:00:01:00:01" do
- before { @vhost.mac "00:00:00:01:00:01" }
+ context 'when mac is 00:00:00:01:00:01' do
+ before { @vhost.mac '00:00:00:01:00:01' }
- it { should == "00:00:00:01:00:01" }
+ it { should == '00:00:00:01:00:01' }
end
end
end
end
end