maxgillett / s3_multipart

Direct multipart uploading to Amazon S3 in Rails
MIT License
290 stars 61 forks source link

How do you get the tests to run? #27

Open JohnSmall opened 10 years ago

JohnSmall commented 10 years ago

I'm following the instructions to run the gem test suite. I created setup_credentials.rb and put the suggested code in it and tried rspec spec which gives this error spec/setup_credentials.rb:6:in `block in <top (required)>': uninitialized constant S3Multipart::Version (NameError)

So I then removed setup_credentials.rb and tried again and got gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- setup_credentials.rb (LoadError)

Where do I go from here? Following the instructions gives an error, yet there is definitely code in specs so it must have worked at some point.

JohnSmall commented 10 years ago

Ok, I got the rspec tests to run by removing the code that checks the version number in lib/s3_multipart/config.rb, which allows me to remove setting the version number to S3Multipart::Version in setup_credentials. I also added the vcr and webmock gems to the test suite. But now I'm stuck on the Jasmine tests.

I'm new to Javascript testing so I'm going up a steep learning curve. I've worked out that the current tests are set up for an old version of Grunt and and old version of Jasmine. So I'm updating them to work with the latest versions of these tools. But now I'm stuck on the spies. I get these errors

X has multiple parts TypeError: 'undefined' is not a function (evaluating 'spyOn(s3mp, 'createXhrRequest').and.CallThrough()')

and similar wherever spyOn is used.

Does anyone else have this problem? Has anyone else tried upgrading to the latest Grunt and Jasmine? Can you get it to work?