Sha256: 473657c92c369eb8902f3d4a9fa66e0ce25d34f5644f015b9ccadc8198879799

Contents?: true

Size: 793 Bytes

Versions: 18

Compression:

Stored size: 793 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe ProxyTester::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 = ProxyTester::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 = ProxyTester::Data.new(config)
      result = data.lookup('pid_file')
      expect(result).to eq('/path/pid_file')
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
proxy_tester-0.1.10 spec/data_spec.rb
proxy_tester-0.1.8 spec/data_spec.rb
proxy_tester-0.1.6 spec/data_spec.rb
proxy_tester-0.1.5 spec/data_spec.rb
proxy_tester-0.1.4 spec/data_spec.rb
proxy_tester-0.1.3 spec/data_spec.rb
proxy_tester-0.1.2 spec/data_spec.rb
proxy_tester-0.1.1 spec/data_spec.rb
proxy_tester-0.1.0 spec/data_spec.rb
proxy_tester-0.0.9 spec/data_spec.rb
proxy_tester-0.0.8 spec/data_spec.rb
proxy_tester-0.0.7 spec/data_spec.rb
proxy_tester-0.0.6 spec/data_spec.rb
proxy_tester-0.0.5 spec/data_spec.rb
proxy_tester-0.0.4 spec/data_spec.rb
proxy_tester-0.0.3 spec/data_spec.rb
proxy_tester-0.0.2 spec/data_spec.rb
proxy_tester-0.0.1 spec/data_spec.rb