Sha256: 5de038b7c97719c36994aaad729ecb72258dd6dacf68a096861a0fdf7799c072

Contents?: true

Size: 715 Bytes

Versions: 17

Compression:

Stored size: 715 Bytes

Contents

# encoding: utf-8

class Nanoc::ContextTest < MiniTest::Unit::TestCase

  include Nanoc::TestHelpers

  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/nanoc/base/context.rb')

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

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
nanoc-3.6.1 test/base/test_context.rb
nanoc-3.6.0 test/base/test_context.rb
nanoc-3.5.0 test/base/test_context.rb
nanoc-3.5.0b2 test/base/test_context.rb
nanoc-3.5.0b1 test/base/test_context.rb
nanoc-3.4.3 test/base/test_context.rb
nanoc-3.4.2 test/base/test_context.rb
nanoc-3.4.1 test/base/test_context.rb
nanoc-3.4.0 test/base/test_context.rb
nanoc-3.3.7 test/base/test_context.rb
nanoc-3.3.6 test/base/test_context.rb
nanoc-3.3.5 test/base/test_context.rb
nanoc-3.3.4 test/base/test_context.rb
nanoc-3.3.3 test/base/test_context.rb
nanoc-3.3.2 test/base/test_context.rb
nanoc-3.3.1 test/base/test_context.rb
nanoc-3.3.0 test/base/test_context.rb