is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
is a software development process that relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards.
= Account.new(100) account_2 = Account.new(50) # When I transfer money transfer(20, from: account_1, to: account_2) # Then the balances should be updated account_1.balance.should eq(80) account_2.balance.should eq(70) ➊ Arrange ➋ Act ➌ Assert
report Scenario: Requesting a Night Audit Report Given I am logged in And CRM is ready to run night audit When I request a night audit report Then the night audit report should be run Scenario: Requesting another report while one is queued Given I am logged in And I have already pressed the night audit button When I request a night audit report Then it should tell me that the report is already queued Scenario: [etc...]
report Scenario: Requesting a Night Audit Report Given I am logged in And CRM is ready to run night audit When I request a night audit report Then the night audit report should be run Scenario: Requesting another report while one is queued Given I am logged in And I have already pressed the night audit button When I request a night audit report Then it should tell me that the report is already queued Scenario: [etc...]
"when there is no group with the same name" do it "returns a new record" do expect(VlanGroup.with_name "foo").to eq VlanGroup.new(name: "foo") end end context "when there is a group with the same name" do let!(:vlan_group) { VlanGroup.create name: "foo", device_count: 1 } it "returns it" do expect(VlanGroup.with_name "foo").to eq vlan_group end end end end
there is no group with the same name returns a new record when there is a group with the same name returns it Finished in 0.17416 seconds 2 examples, 0 failures
there is no group with the same name returns a new record (FAILED - 1) when there is a group with the same name returns it Failures: 1) VlanGroup.with_name when there is no group with the same name returns a new record Failure/Error: expect(VlanGroup.with_name "foo").to eq VlanGroup.new(name: "foo") expected: #<VlanGroup @name="foo" @device_count=nil @url=nil> got: nil (compared using ==) # ./spec/unit/models/vlan_group_spec.rb:8:in `block (4 levels) in <top (required)>' # ./spec/support/database_hooks.rb:10:in `block (2 levels) in <top (required)>' Finished in 0.17733 seconds 2 examples, 1 failure
code unless it is to make a failing unit test pass 2. Do not write any more of a unit test than is sufficient to fail (compilation errors count!) 3. Do not write any more production code than is sufficient to pass the one failing unit test