Sha256: 3049ca56c102ecd4731ea8f85289efb99241e8f202e254163a5cf77c385f2d7d
Contents?: true
Size: 734 Bytes
Versions: 15
Compression:
Stored size: 734 Bytes
Contents
Feature: stub implementation As an rspec user, I want to stub a complete implementation, not just a return value. Scenario: stub implementation Given a file named "stub_implementation.rb" with: """ describe "a stubbed implementation" do it "works" do object = Object.new object.stub(:foo) do |arg| if arg == :this "got this" elsif arg == :that "got that" end end object.foo(:this).should == "got this" object.foo(:that).should == "got that" end end """ When I run "spec stub_implementation.rb" Then the stdout should match "1 example, 0 failures"
Version data entries
15 entries across 15 versions & 2 rubygems