Compare projects
Project comparisons allow you to view any selection of projects side by side just like they're shown on regular categories or in search results. You can try out an example or start yourself by adding a library to the comparison via the input below. You can also easily share your current comparison with others by sending the URL of the current page.
0.0
advanced_subject attempts to cut out having to explicitly write the subject of your example group when trying to call methods or add arguments to methods. It works by reading the conventional description syntax to determine what the method you are calling is and later you state what you are passing to it.
Given you have a file advanced_subject_spec.rb.
```ruby
describe Hash do
when_initialized_with [:a, :b] do
it { should eq({a: :b}) }
describe '#fetch' do
when_passed :a do
it { should eq(:b) }
end
end
end
end
```
When you run `rspec -f d advanced_subject_spec.rb` it will output:
```
Hash
when initialized with [:a, :b]
should eq {:a => :b}
#fetch
when passed :a
should eq :b
```
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026