Sha256: 76b243a045d9c5ac1584a57b9f631ec63d29876685dc06b24824fefd6297ecc0

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

$:.unshift(File.expand_path('../../lib', __FILE__))

require 'pathname'
require 'logger'

root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path  = root_path.join('lib')
log_path  = root_path.join('log')
log_path.mkpath

require 'rubygems'
require 'bundler'

Bundler.require(:default, :test)

require 'flipper'

Logger.new(log_path.join('test.log'))

RSpec.configure do |config|
  config.filter_run :focused => true
  config.alias_example_to :fit, :focused => true
  config.alias_example_to :xit, :pending => true
  config.run_all_when_everything_filtered = true

  config.before(:each) do
    Flipper.groups = nil
    Timecop.return
  end
end

shared_examples_for 'a percentage' do
  it "initializes with value" do
    percentage = described_class.new(12)
    percentage.should be_instance_of(described_class)
  end

  it "converts string values to integers when initializing" do
    percentage = described_class.new('15')
    percentage.value.should eq(15)
  end

  it "has a value" do
    percentage = described_class.new(19)
    percentage.value.should eq(19)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-0.2.0 spec/helper.rb
flipper-0.1.1 spec/helper.rb
flipper-0.1.0 spec/helper.rb