Sha256: c49fe5906f72456dc7af541f51ee12bdd356bc8d627f173933c75b2f6a9e8301

Contents?: true

Size: 721 Bytes

Versions: 8

Compression:

Stored size: 721 Bytes

Contents

# encoding: utf-8

class Nanoc3::ContextTest < MiniTest::Unit::TestCase

  include Nanoc3::TestHelpers

  def test_context_with_instance_variable
    # Create context
    context = Nanoc3::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 = Nanoc3::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/nanoc3/base/context.rb')

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

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nanoc3-3.2.4 test/base/test_context.rb
nanoc3-3.2.3 test/base/test_context.rb
nanoc3-3.2.2 test/base/test_context.rb
nanoc3-3.2.1 test/base/test_context.rb
nanoc3-3.2.0 test/base/test_context.rb
nanoc3-3.2.0b3 test/base/test_context.rb
nanoc3-3.2.0b2 test/base/test_context.rb
nanoc3-3.2.0b1 test/base/test_context.rb