Sha256: 3e538a582f5930f4c7a47934aa675421c477de0fb788bf7b360ddc9d18bdb93f

Contents?: true

Size: 784 Bytes

Versions: 28

Compression:

Stored size: 784 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe LocalPac::Data do
  context '#instance_binding' do
    it 'let you lookup variables' do
      config = Class.new(Module) do
        def pid_file
          '/path/pid_file'
        end
      end.new

      data = LocalPac::Data.new(config)
      # rubocop:disable Eval
      result = eval('lookup("pid_file")', data.instance_binding)
      # rubocop:enable Eval
      expect(result).to eq('/path/pid_file')
    end
  end

  context '#lookup' do
    it 'let you lookup variables' do
      config = Class.new(Module) do
        def pid_file
          '/path/pid_file'
        end
      end.new

      data = LocalPac::Data.new(config)
      result = data.lookup('pid_file')
      expect(result).to eq('/path/pid_file')
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
local_pac-0.10.2 spec/data_spec.rb
local_pac-0.10.1 spec/data_spec.rb
local_pac-0.10.0 spec/data_spec.rb
local_pac-0.9.0 spec/data_spec.rb
local_pac-0.7.0 spec/data_spec.rb
local_pac-0.6.3 spec/data_spec.rb
local_pac-0.6.2 spec/data_spec.rb
local_pac-0.6.1 spec/data_spec.rb
local_pac-0.5.0 spec/data_spec.rb
local_pac-0.4.0 spec/data_spec.rb
local_pac-0.3.0 spec/data_spec.rb
local_pac-0.2.3 spec/data_spec.rb
local_pac-0.2.2 spec/data_spec.rb
local_pac-0.2.1 spec/data_spec.rb
local_pac-0.2.0 spec/data_spec.rb
local_pac-0.1.13 spec/data_spec.rb
local_pac-0.1.11 spec/data_spec.rb
local_pac-0.1.10 spec/data_spec.rb
local_pac-0.1.9 spec/data_spec.rb
local_pac-0.1.8 spec/data_spec.rb