lib/grumlin/test/rspec/gremlin_context.rb in grumlin-0.23.0 vs lib/grumlin/test/rspec/gremlin_context.rb in grumlin-1.0.0.rc1

- old
+ new

@@ -1,25 +1,27 @@ # frozen_string_literal: true -module Grumlin - module Test - module RSpec - module GremlinContext - end +module Grumlin::Test::RSpec + module GremlinContext + end - ::RSpec.shared_context GremlinContext do - include GremlinContext - include Grumlin::Sugar + ::RSpec.shared_context GremlinContext do + include GremlinContext + include Grumlin::Expressions - before do - Grumlin::Expressions.constants.each do |tool| - stub_const(tool.to_s, Grumlin::Expressions.const_get(tool)) - end - end + [:__, :g].each do |name| + define_method(name) do |cuts = Grumlin::Shortcuts::Storage.empty| + cuts.send(name) + end + end - after do - Grumlin.close - end + before do + Grumlin::Expressions.constants.each do |tool| + stub_const(tool.to_s, Grumlin::Expressions.const_get(tool)) end + end + + after do + Grumlin.close end end end