You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to guar...@googlegroups.com
My test suite has shared_examples that are included in many spec files.
When I edit my shared_example file, what is the best way to auto-run all of the specs that include the shared example?
Andy L
unread,
Jun 5, 2014, 10:28:31 PM6/5/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to guar...@googlegroups.com
FYI here is how I solved the problem:
1. adopted a file naming convention - shared examples go in *_shared.rb 2. comment goes in the *_shared.rb file - eg "#required_by: model/file1 model/file2" 3. a watcher triggers off the shared file and calls a method that generates a list of consumers
4. here is the method that parses the shared file and generates a list of consumers:
def consumers_for(share_file) tgts = [] File.open(share_file).each do |line| if %r{^#required_by:(.*)$}.match(line) tgts += $1.split end end tgts.map {|tgt| "spec/#{tgt}_spec.rb"}.sort.uniq end
Cezary Baginski
unread,
Dec 21, 2014, 1:35:12 PM12/21/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to guar...@googlegroups.com
I've wanted a feature like this for months - for RSpec to automatically match files if there's no other match.