Sha256: 235966b693ac39d3f503ee921137500b6831ebc023e6fe0855340bca864797aa

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

require 'ostruct'

# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
$: << File.expand_path('../../lib', __FILE__)
$: << File.expand_path('../../rolls', __FILE__)
$: << File.expand_path('../fixtures', __FILE__)

require 'yuyi'

RSpec.configure do |config|
  config.alias_example_to :the

  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.order = :random

  config.before do
    allow(Yuyi).to receive(:say)
    allow(ProgressBar).to receive(:create)
    allow_any_instance_of(Yuyi::Menu).to receive_message_chain('progressbar.reset')
    allow_any_instance_of(Yuyi::Menu).to receive_message_chain('progressbar.increment')
  end
end

# Allow true/false to respond to Boolean class
module Boolean; end
class TrueClass; include Boolean; end
class FalseClass; include Boolean; end

class Object
  def var var, value = nil
    if self.instance_of? Class
      class_var var, value
    else
      instance_var var, value
    end
  end

  def class_var var, value = nil
    if value
      self.send(:class_variable_set, :"@@#{var}", value)
    else
      self.send(:class_variable_get, :"@@#{var}")
    end
  end

  def instance_var var, value = nil
    if value
      self.send(:instance_variable_set, :"@#{var}", value)
    else
      self.send(:instance_variable_get, :"@#{var}")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yuyi-1.1.7 spec/spec_helper.rb
yuyi-1.1.6 spec/spec_helper.rb
yuyi-1.1.5 spec/spec_helper.rb