Sha256: 2e7657ed8d0b052f349d3476e3240f0c8ee5746cc19169a1760682e501a88a45
Contents?: true
Size: 1 KB
Versions: 17
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe Sinclair::Matchers::ChangeInstanceMethod do describe 'yard' do describe '#on' do context 'when checking against Class' do let(:klass) { Class.new(MyModel) } let(:builder) { Sinclair.new(klass) } before do builder.add_method(:the_method) { 10 } builder.build builder.add_method(:the_method) { 20 } end it do expect { builder.build }.to change_method(:the_method).on(klass) end end context 'when checking against an intance' do let(:klass) { Class.new(MyModel) } let(:instance) { klass.new } let(:builder) { Sinclair.new(klass) } before do builder.add_method(:the_method) { 10 } builder.build builder.add_method(:the_method) { 20 } end it do expect { builder.build }.to change_method(:the_method).on(instance) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems