:last) do def name [first, last].join(' ') end end ! it "combines first and last" do bob = person.new('Bob', 'Jones') expect(bob.name).to eq 'Bob Jones' end ! end
does something Failure/Error: my_obj = instance_double("M MyObject does not implement: does # ./verified_doubles_in_situ_spec.rb:7:in ! Finished in 0.00046 seconds (files took 0.07 1 example, 1 failure
end end ! RSpec.configuration.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end ! it "does something" do my_obj = MyObject.new allow(my_obj).to receive(:other) { "things" } expect(my_obj.other).to eq "things" end end
does something Failure/Error: allow(my_obj).to receive(:o #<MyObject:0x00000101820288> does not implement: other # ./verify_partial_doubles_spec.rb:13:in ! Finished in 0.00562 seconds (files took 0.08 1 example, 1 failure
RuntimeError: let declaration `thing` accessed in a `before(:context)` hook at: examples/brok `let` and `subject` declarations are not intended to be called in a `before(:conte hook, as they exist to define state that is reset between each example, while
receive The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported. # ./before_all_stubs_broken_spec.rb:4:in ! Finished in 0.00504 seconds (files took 0.07 1 example, 1 failure
{ is_expected.to be_a String } ! describe '#length' do subject { super().length } it { is_expected.to eq(8) } end ! specify do expect(string).to eq("a string") end ! end