spec/trema/error_spec.rb in trema-0.4.6 vs spec/trema/error_spec.rb in trema-0.4.7
- old
+ new
@@ -14,63 +14,63 @@
# 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"
+require File.join(File.dirname(__FILE__), '..', 'spec_helper')
+require 'trema'
module Trema
- describe Error, ".new", :nosudo => true do
- it { expect { subject }.to raise_error( ArgumentError, "Type and code are mandatory options" ) }
+ describe Error, '.new', :nosudo => true do
+ it { expect { subject }.to raise_error(ArgumentError, 'Type and code are mandatory options') }
end
- describe Error, ".new(nil)", :nosudo => true do
- it { expect { subject }.to raise_error( ArgumentError, "Type and code are mandatory options" ) }
+ describe Error, '.new(nil)', :nosudo => true do
+ it { expect { subject }.to raise_error(ArgumentError, 'Type and code are mandatory options') }
end
- describe Error, ".new(:type => value)", :nosudo => true do
- subject { Error.new( :type => OFPET_BAD_REQUEST ) }
- it { expect { subject }.to raise_error( ArgumentError, "Code is a mandatory option" ) }
+ describe Error, '.new(:type => value)', :nosudo => true do
+ subject { Error.new(:type => OFPET_BAD_REQUEST) }
+ it { expect { subject }.to raise_error(ArgumentError, 'Code is a mandatory option') }
end
- describe Error, ".new(:code => value)", :nosudo => true do
- subject { Error.new( :code => OFPBRC_BAD_TYPE ) }
- it { expect { subject }.to raise_error( ArgumentError, "Type is a mandatory option" ) }
+ describe Error, '.new(:code => value)', :nosudo => true do
+ subject { Error.new(:code => OFPBRC_BAD_TYPE) }
+ it { expect { subject }.to raise_error(ArgumentError, 'Type is a mandatory option') }
end
- describe Error, ".new(:type => value, :code => value)" do
- subject { Error.new( :type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE ) }
- it_should_behave_like "any Openflow message with default transaction ID"
- its( :error_type ) { should == OFPET_BAD_REQUEST }
- its( :code ) { should == OFPBRC_BAD_TYPE }
- its( :data ) { should be_nil }
+ describe Error, '.new(:type => value, :code => value)' do
+ subject { Error.new(:type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE) }
+ it_should_behave_like 'any Openflow message with default transaction ID'
+ its(:error_type) { should == OFPET_BAD_REQUEST }
+ its(:code) { should == OFPBRC_BAD_TYPE }
+ its(:data) { should be_nil }
end
- describe Error, ".new(:type => value, :code => value, :transaction_id => value)" do
- subject { Error.new( :type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE, :transaction_id => transaction_id ) }
- it_should_behave_like "any Openflow message with transaction ID"
+ describe Error, '.new(:type => value, :code => value, :transaction_id => value)' do
+ subject { Error.new(:type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE, :transaction_id => transaction_id) }
+ it_should_behave_like 'any Openflow message with transaction ID'
end
- describe Error, ".new(:type => value, :code => value, :xid => value)" do
- subject { Error.new( :type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE, :xid => xid ) }
- it_should_behave_like "any Openflow message with xid"
+ describe Error, '.new(:type => value, :code => value, :xid => value)' do
+ subject { Error.new(:type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE, :xid => xid) }
+ it_should_behave_like 'any Openflow message with xid'
end
- describe Error, ".new(:type => value, :code => value, :data => value)" do
- subject { Error.new( :type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE, :data => "deadbeef" ) }
- it_should_behave_like "any Openflow message with default transaction ID"
- its( :error_type ) { should == OFPET_BAD_REQUEST }
- its( :code ) { should == OFPBRC_BAD_TYPE }
- its( :data ) { should == "deadbeef" }
+ describe Error, '.new(:type => value, :code => value, :data => value)' do
+ subject { Error.new(:type => OFPET_BAD_REQUEST, :code => OFPBRC_BAD_TYPE, :data => 'deadbeef') }
+ it_should_behave_like 'any Openflow message with default transaction ID'
+ its(:error_type) { should == OFPET_BAD_REQUEST }
+ its(:code) { should == OFPBRC_BAD_TYPE }
+ its(:data) { should == 'deadbeef' }
end
end
### Local variables: