File: object_spec.rb

package info (click to toggle)
ruby-commander 4.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 360 kB
  • sloc: ruby: 1,971; makefile: 9
file content (21 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

describe Object do
  describe '#get_binding' do
    it 'should return the objects binding' do
      expect(-> {}.get_binding).to be_instance_of(Binding)
    end
  end

  describe '#method_missing' do
    it 'should preserve its original behavior for missing methods' do
      expect { send(:i_am_a_missing_method) }.to raise_error(NoMethodError)
    end

    it 'should preserve its original behavior for missing variables' do
      expect { i_am_a_missing_variable }.to raise_error(NameError)
    end
  end
end