Sha256: 0066fea24c4e1d634aa6c9dd8c422d744c95099fe61b0b93e8657c34096a58a7

Contents?: true

Size: 773 Bytes

Versions: 5

Compression:

Stored size: 773 Bytes

Contents

require 'rspec/matchers/built_in/base_matcher'

module RSpec
  module Matchers
    module BuiltIn
      class BaseMatcher
        # activesupport/lib/active_support/inflector/methods.rb, line 48
        # mutable strings fixed for opal
        def self.underscore(camel_cased_word)
          word = camel_cased_word.to_s.dup
          word = word.gsub(/::/, '/')
          word = word.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
          word = word.gsub(/([a-z\d])([A-Z])/, '\1_\2')
          word = word.tr("-", "_")
          word.downcase
        end

        def description
          desc = EnglishPhrasing.split_words(self.class.matcher_name)
          desc += EnglishPhrasing.list(@expected) if defined?(@expected)
          desc
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-rspec-1.1.0.alpha3 lib-opal/opal/rspec/fixes/rspec/matchers/built_in/base_matcher.rb
opal-rspec-1.1.0.alpha2 lib-opal/opal/rspec/fixes/rspec/matchers/built_in/base_matcher.rb
opal-rspec-1.1.0.alpha1 lib-opal/opal/rspec/fixes/rspec/matchers/built_in/base_matcher.rb
opal-rspec-1.0.0 lib-opal/opal/rspec/fixes/rspec/matchers/built_in/base_matcher.rb
opal-rspec-1.0.0.alpha1 lib-opal/opal/rspec/fixes/rspec/matchers/built_in/base_matcher.rb