File: object_extensions_test.rb

package info (click to toggle)
ruby-flexmock 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 840 kB
  • sloc: ruby: 7,598; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env ruby

require 'test_helper'
require 'flexmock/object_extensions'

class ObjectExtensionsTest < Minitest::Test
  def setup
    @obj = Object.new
    def @obj.smethod
      :ok
    end
  end

  def test_undefined_methods_are_not_singletons
    assert ! @obj.flexmock_singleton_defined?(:xyzzy)
  end

  def test_normal_methods_are_not_singletons
    assert ! @obj.flexmock_singleton_defined?(:to_s)
  end

  def test_singleton_methods_are_singletons
    assert @obj.flexmock_singleton_defined?(:smethod)
  end
end