spec/handlers/ruby/legacy/base_spec.rb in yard-0.9.5 vs spec/handlers/ruby/legacy/base_spec.rb in yard-0.9.6
- old
+ new
@@ -1,10 +1,10 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+# frozen_string_literal: true
include Parser::Ruby::Legacy
-describe YARD::Handlers::Ruby::Legacy::Base, "#handles and inheritance" do
+RSpec.describe YARD::Handlers::Ruby::Legacy::Base, "#handles and inheritance" do
before do
allow(Handlers::Ruby::Legacy::Base).to receive(:inherited)
if RUBY_VERSION > '1.8.7'
allow(Handlers::Ruby::Legacy::MixinHandler).to receive(:inherited) # fixes a Ruby1.9 issue
end
@@ -39,11 +39,11 @@
expect(TestStringHandler.handles?(stmt("nothello world"))).to be false
end
it "handles regex input" do
class TestRegexHandler < Handlers::Ruby::Legacy::Base
- handles /^nothello$/
+ handles(/^nothello$/)
end
expect(TestRegexHandler.handles?(stmt("nothello"))).to be true
expect(TestRegexHandler.handles?(stmt("not hello hello"))).to be false
end
@@ -57,10 +57,10 @@
expect(TestTokenHandler.handles?(stmt("if"))).to be false
end
it "parses a do/end or { } block with #parse_block" do
class MyBlockHandler < Handlers::Ruby::Legacy::Base
- handles /\AmyMethod\b/
+ handles(/\AmyMethod\b/)
def process
parse_block(:owner => "test")
end
end