fedora-migrator /vendor/gems/facets-2.4.5/test/core/binding/test_opvars.rb

Language Ruby Lines 25
MD5 Hash 0b22123a837aeef0db858763d2257e86 Estimated Cost $398 (why?)
Repository https://bitbucket.org/mediashelf/fedora-migrator View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'facets/binding/opvars'
require 'test/unit'

class TestBindingVariables < Test::Unit::TestCase

  def setup
    a = 1
    b = 2
    x = "hello"
    # the line number must be updated if it moves
    @bind = binding; @this_line_no = __LINE__
    @this_file_name = File.basename( __FILE__ ) # why does it equal basename only?
  end

  def test_op_store
    assert_nothing_raised{ @bind["x"] = "goodbye" }
    assert_equal( "goodbye", @bind["x"] )
  end

  def test_op_fetch
    assert_equal( "hello", @bind["x"] )
  end

end
Back to Top