Sha256: be93410c6ecf0e6345f18ef24a2c724c157c3edf62292f52b39a7ab3694c7124

Contents?: true

Size: 577 Bytes

Versions: 61

Compression:

Stored size: 577 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 yellow(string)
      "\e[0;33m#{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

61 entries across 61 versions & 1 rubygems

Version Path
shelly-0.3.0 spec/helpers.rb
shelly-0.2.28 spec/helpers.rb
shelly-0.2.27 spec/helpers.rb
shelly-0.2.26 spec/helpers.rb
shelly-0.2.25 spec/helpers.rb
shelly-0.2.24 spec/helpers.rb
shelly-0.2.23 spec/helpers.rb
shelly-0.2.22 spec/helpers.rb
shelly-0.2.21 spec/helpers.rb
shelly-0.2.20 spec/helpers.rb
shelly-0.2.19 spec/helpers.rb
shelly-0.2.18 spec/helpers.rb
shelly-0.2.17 spec/helpers.rb
shelly-0.2.16 spec/helpers.rb
shelly-0.2.15 spec/helpers.rb
shelly-0.2.14 spec/helpers.rb
shelly-0.2.13 spec/helpers.rb
shelly-0.2.12 spec/helpers.rb
shelly-0.2.11 spec/helpers.rb
shelly-0.2.10 spec/helpers.rb