Skip to content

Instantly share code, notes, and snippets.

@libbyschuknight
Last active December 21, 2015 20:25
Show Gist options
  • Save libbyschuknight/a7b384c803e6debd6048 to your computer and use it in GitHub Desktop.
Save libbyschuknight/a7b384c803e6debd6048 to your computer and use it in GitHub Desktop.
rspec ideas / ways of doing
expect( this action ).to change( something ).by(1)
# trick
expect(response.body).to eql ""
### Use of 'anything' below
# old? - https://www.relishapp.com/rspec/rspec-mocks/v/2-7/docs/argument-matchers/general-matchers
# http://blog.endpoint.com/2014/09/rspecs-anything-argument-matcher.html
# http://www.rubydoc.info/gems/rspec-mocks/RSpec/Mocks/ArgumentMatchers
it "appends the error code to the filename and moves it to output files folder" do
file = "3JCC_E_FLICK_EIEP13C_201510_20151007_5987.csv"
param2 = "../output_files/3JCC_E_FLICK_EIEP13C_201510_20151007_5987_E500_EIEPInvalidFileName.csv"
expect(FileUtils).to receive(:mv).with(anything, param2)
FilenameValidator.filename_validation(file)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment