File tree Expand file tree Collapse file tree 10 files changed +12
-12
lines changed
Expand file tree Collapse file tree 10 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def initialize(param)
2525 @source = OpenSCAP ::Source . new ( param )
2626 @session = OpenSCAP . ds_rds_session_new_from_source @source . raw
2727 else
28- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::DS:Arf with '#{ param } '"
28+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with '#{ param } '"
2929 end
3030 OpenSCAP . raise! if @session . null?
3131 end
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def initialize(param)
2626 when FFI ::Pointer
2727 @raw = param
2828 else
29- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Source with '#{ param } '"
29+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with '#{ param } '"
3030 end
3131 OpenSCAP . raise! if @raw . null?
3232 end
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module OpenSCAP
1313 module Xccdf
1414 class Fix
1515 def initialize ( raw )
16- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Reference with '#{ raw } '" \
16+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with '#{ raw } '" \
1717 unless raw . is_a? ( FFI ::Pointer )
1818 @raw = raw
1919 end
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ module OpenSCAP
1919 module Xccdf
2020 class Item
2121 def self . build ( t )
22- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Item with #{ t } " \
22+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with #{ t } " \
2323 unless t . is_a? ( FFI ::Pointer )
2424 # This is Abstract base class that enables you to build its child
2525 case OpenSCAP . xccdf_item_get_type t
@@ -28,13 +28,13 @@ def self.build(t)
2828 when :rule
2929 OpenSCAP ::Xccdf ::Rule . new t
3030 else
31- raise OpenSCAP ::OpenSCAPError , "Unknown Xccdf::Item type: #{ OpenSCAP . xccdf_item_get_type t } "
31+ raise OpenSCAP ::OpenSCAPError , "Unknown #{ self . class . name } type: #{ OpenSCAP . xccdf_item_get_type t } "
3232 end
3333 end
3434
3535 def initialize ( t )
3636 if self . class == OpenSCAP ::Xccdf ::Item
37- raise OpenSCAP ::OpenSCAPError , ' Cannot initialize Xccdf::Item abstract base class.'
37+ raise OpenSCAP ::OpenSCAPError , " Cannot initialize #{ self . class . name } abstract base class."
3838 end
3939 @raw = t
4040 end
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def initialize(p)
2121 when FFI ::Pointer
2222 @raw = p
2323 else
24- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Profile with #{ p } "
24+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with #{ p } "
2525 end
2626 end
2727
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module OpenSCAP
1313 module Xccdf
1414 class Reference
1515 def initialize ( raw )
16- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Reference with '#{ raw } '" \
16+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with '#{ raw } '" \
1717 unless raw . is_a? ( FFI ::Pointer )
1818 @raw = raw
1919 end
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def initialize(t)
2020 when FFI ::Pointer
2121 @rr = t
2222 else
23- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::RuleResult with #{ t } "
23+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with #{ t } "
2424 end
2525 end
2626
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def initialize(source, benchmark)
2222 when OpenSCAP ::Source
2323 @raw = OpenSCAP . xccdf_tailoring_import_source source . raw , benchmark
2424 else
25- raise OpenSCAP ::OpenSCAPError , "Cannot initialize OpenSCAP::Xccdf::Tailoring with '#{ source } '"
25+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with '#{ source } '"
2626 end
2727 OpenSCAP . raise! if @raw . null?
2828 end
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def initialize(t)
2929 @raw = OpenSCAP . xccdf_result_import_source ( t )
3030 OpenSCAP . raise! if @raw . null?
3131 else
32- raise OpenSCAP ::OpenSCAPError , "Cannot initialize TestResult with #{ t } "
32+ raise OpenSCAP ::OpenSCAPError , "Cannot initialize #{ self . class . name } with #{ t } "
3333 end
3434 init_ruleresults
3535 end
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def test_arf_new_nil
2424 rescue OpenSCAP ::OpenSCAPError => e
2525 msg = e . to_s
2626 end
27- assert msg . start_with? ( "Cannot initialize OpenSCAP::DS:Arf with ''" ) , 'Message was: ' + msg
27+ assert msg . start_with? ( "Cannot initialize OpenSCAP::DS:: Arf with ''" ) , 'Message was: ' + msg
2828 end
2929
3030 def test_arf_new_wrong_format
You can’t perform that action at this time.
0 commit comments