1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
require 'parslet'
require 'parslet/rig/rspec'
require 'parslet/atoms/visitor'
require 'parslet/export'
require 'ae'
RSpec.configure do |config|
config.mock_with :flexmock
begin
# Here's to the worst idea ever, rspec. This is why we'll be leaving you soon.
config.expect_with :rspec do |c|
c.syntax = [:should, :expect]
end
rescue NoMethodError
# If the feature is missing, ignore it.
end
# Exclude other ruby versions by giving :ruby => 1.8 or :ruby => 1.9
#
config.filter_run_excluding :ruby => lambda { |version|
RUBY_VERSION.to_s !~ /^#{Regexp.escape(version.to_s)}/
}
end
def catch_failed_parse
begin
yield
rescue Parslet::ParseFailed => exception
end
exception.parse_failure_cause
end
def slet name, &block
let(name, &block)
subject(&block)
end
|