Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test importer #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Test importer #46

wants to merge 2 commits into from

Conversation

alexanderblair
Copy link
Contributor

DO NOT MERGE THIS

Test importer attempting to create a CSV importer, plus updates to
gemfile.lock
Have been trying to test the Test Importer using rspec. This is my code
so far, having issues when trying to run the test script, which I will
outline in the comments
@alexanderblair
Copy link
Contributor Author

I have made an attempt to test the importer I have been trying to create. I am running into some issues when I have tried to run the spec file. Im getting the error
/Users/alexblair/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file -- spec_helper (LoadError) from /Users/alexblair/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in 'require'

I have tried this http://stackoverflow.com/questions/5150293/in-require-no-such-file-to-load-spec-helper . This doesnt seem to have worked as I am still getting an error, have you guys got any ideas?

@alexanderblair
Copy link
Contributor Author

Have fixed that issue now, and the code successfully runs, and I get the message rspec ./spec/classes/importers/test_importer_spec.rb:8 # TestImporter can read CSV
I now however get an error saying that:

TestImporter can read CSV
Failure/Error: status = importer.read_row(values, Array.new)
NoMethodError:
undefined method `name=' for nil:NilClass
# ./app/classes/importers/test_importer.rb:8:in 'read_row'
# ./spec/classes/importers/test_importer_spec.rb:13:in 'block (2 levels) in <top (required)>''

The # ./spec/classes/importers/test_importer_spec.rb:13:in block (2 levels) in <top (required)>'
is probably a style/syntax thing.

The one I cant seem to get right is the undefined method 'name=' for nil:NilClass # ./app/classes/importers/test_importer.rb:8:in 'read_row' is slightly more problematic. I know this is relating to the @tst.name = however I cant figure out from other importers if I have to define that somewhere, so any advice on that would be appreciated!

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

Successfully merging this pull request may close these issues.

1 participant