Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

StorageProvider spec improvements. #26

Open
8 tasks
richardkmichael opened this issue Feb 7, 2013 · 0 comments
Open
8 tasks

StorageProvider spec improvements. #26

richardkmichael opened this issue Feb 7, 2013 · 0 comments
Labels

Comments

@richardkmichael
Copy link
Owner

  • Re-factor to use implicit subject and review expectations.
  • We use mocks with .and_call_original because the methods being
    tested must execute the rest of the method to decorate the returned
    File. Alternately, we could use .and_return(@active_record_file_mock)
    to inject the correct type of file [build it from a Factory, because
    otherwise, the mocked file and the real File will eventually be out of
    sync.
  • Remove deep "implementation" testing, e.g. "calls #create!".
  • Instead of specing the return behavior of "store!" and
    "retrieve!", should we spec the return behaviour of only "retrieve!"
    and then specifiy that "store!" and "retrieve!" should return the same
    thing?
  • DRY URL spec with "shared_examples" / "it_behaves_like" / helper method module?
  • Use a named subject to fix the initialization of the StorageProvider under test.
  • Remove indirect and deep testing of File via uploader and should_receive (write it as a stub):

File.should_receive(:create!).with(file, identifier).and_call_original

File.should_receive(:fetch!).with(identifier).and_call_original

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant