Sha256: 7b7758ecc3f4e4dd6d18557ac624e14f7c43398c46146ef66050298c9a50a8b2
Contents?: true
Size: 830 Bytes
Versions: 24
Compression:
Stored size: 830 Bytes
Contents
RSpec.describe "EitilCore Kernel#raise_error" do # Call specs directly on Kernel, which you would usually do implicit # instead of explicit, in order to escape the RSpec namespace, which has # it's own effects for raised errors it "should define a new constant, if the error class does not yet exist" do begin Kernel.raise_error "ThisErrorWillProbablyNotExistError" rescue end expect(Kernel.const_defined?('ThisErrorWillProbablyNotExistError')).to eq true end it "should call an existing constant, if the error class already exists" do expect(Kernel.const_defined?('StandardError')) initial_const_count = Module.constants.count begin Kernel.raise_error "StandardError" rescue end expect(Module.constants.count).to eq initial_const_count end end
Version data entries
24 entries across 24 versions & 1 rubygems