Sha256: 658a25a164846cecfe5f970afe4393a565cdfecec8b338146d9a3c139acb6de7

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

# encoding: utf-8

class Nanoc::ContextTest < Nanoc::TestCase
  def test_context_with_instance_variable
    # Create context
    context = Nanoc::Context.new({ foo: 'bar', baz: 'quux' })

    # Ensure correct evaluation
    assert_equal('bar', eval('@foo', context.get_binding))
  end

  def test_context_with_instance_method
    # Create context
    context = Nanoc::Context.new({ foo: 'bar', baz: 'quux' })

    # Ensure correct evaluation
    assert_equal('bar', eval('foo', context.get_binding))
  end

  def test_example
    # Parse
    YARD.parse(LIB_DIR + '/nanoc/base/context.rb')

    # Run
    assert_examples_correct 'Nanoc::Context#initialize'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-3.8.0 test/base/test_context.rb
nanoc-3.7.5 test/base/test_context.rb