Sha256: b8f75ba62802745d4112a493f3dccbb89414d3d5427ae3dcffeda10b60bc1993

Contents?: true

Size: 514 Bytes

Versions: 48

Compression:

Stored size: 514 Bytes

Contents

module RSpec
  module Helpers
    def fake_stdin(strings)
      InputFaker.with_fake_input(strings) { yield }
    end

    def invoke(object, *args)
      object.class.send(:start, args.map { |arg| arg.to_s })
    end

    def green(string)
      "\e[32m#{string}\e[0m"
    end

    def red(string)
      "\e[31m#{string}\e[0m"
    end

    def hooks(model, method)
      model.class.hooks.inject([]) do |result, v|
        result << v[0] if v[1][:only].include?(method)
        result
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
shelly-0.1.13 spec/helpers.rb
shelly-0.1.12 spec/helpers.rb
shelly-0.1.11 spec/helpers.rb
shelly-0.1.10 spec/helpers.rb
shelly-0.1.9 spec/helpers.rb
shelly-0.1.8 spec/helpers.rb
shelly-0.1.7 spec/helpers.rb
shelly-0.1.6 spec/helpers.rb
shelly-0.1.5 spec/helpers.rb
shelly-0.1.4.pre2 spec/helpers.rb
shelly-0.1.4.pre spec/helpers.rb
shelly-0.1.3 spec/helpers.rb
shelly-0.1.2 spec/helpers.rb
shelly-0.1.1 spec/helpers.rb
shelly-0.1.0 spec/helpers.rb
shelly-0.0.62 spec/helpers.rb
shelly-0.0.61 spec/helpers.rb
shelly-0.0.60 spec/helpers.rb
shelly-0.0.59 spec/helpers.rb
shelly-0.0.58 spec/helpers.rb