SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.04k stars 139 forks source link

Update specs to use modern style #321

Closed dshvimer closed 7 years ago

dshvimer commented 7 years ago

Updated the specs to reflect a cleaner style of rspec testing. For info about spec style visit http://betterspecs.org/

dshvimer commented 7 years ago

Currently having an issue with Rubocop:

Metrics/BlockLength: Block has too many lines.

Rubocop is complaining about the length of the Rspec.describe block. I can't imagine being able to reduce it's size. Just figured I'd would mention that.

Otherwise this file is ready for review. Let me know if the style is suitable and I will proceed to work on more specs.

zverok commented 7 years ago

Rubocop is complaining about the length of the Rspec.describe block. I can't imagine being able to reduce it's size. Just figured I'd would mention that.

And yes, block length limitation has no value for specs. It could be disabled in local specs/.rubocop.yml

dshvimer commented 7 years ago

@zverok I made the requested changes. I had an issue testing the :name property.

df.row[0].name #returns 0
df.row[0][:name] #returns "Homer"

It seems that the have_attributes method tests the first variation. I opted to test the :age column instead.

dshvimer commented 7 years ago

@zverok Thank you for the feedback. I moved the declarations into the contexts. The ActiveRecord connection is the default source since it is used twice. So far we have gone from 83 lines to 56 .