forked from rspec/rspec-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore original implementation of its(attribute) from rspec-1.
- original implementation by Stephen Touset - Closes rspec#90.
- Loading branch information
1 parent
e516329
commit 3025753
Showing
5 changed files
with
132 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Feature: attribute of subject | ||
|
||
Scenario: simple attribute | ||
Given a file named "example_spec.rb" with: | ||
""" | ||
describe Array do | ||
its(:size) { should == 0 } | ||
end | ||
""" | ||
When I run "rspec example_spec.rb --format documentation" | ||
Then the output should contain: | ||
""" | ||
Array | ||
size | ||
should == 0 | ||
""" | ||
|
||
Scenario: nested attribute | ||
Given a file named "example_spec.rb" with: | ||
""" | ||
class Person | ||
attr_reader :phone_numbers | ||
def initialize | ||
@phone_numbers = [] | ||
end | ||
end | ||
describe Person do | ||
subject do | ||
person = Person.new | ||
person.phone_numbers << "555-1212" | ||
person | ||
end | ||
its("phone_numbers.first") { should == "555-1212" } | ||
end | ||
""" | ||
When I run "rspec example_spec.rb --format documentation" | ||
Then the output should contain: | ||
""" | ||
Person | ||
phone_numbers.first | ||
should == "555-1212" | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters