-
Notifications
You must be signed in to change notification settings - Fork 28
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
Remove activesupport dependency #22
Remove activesupport dependency #22
Conversation
that sounds great!!!! |
can you add tests for the |
a757756
to
9874f17
Compare
I've added almost the same blank/non_blank cases that activesupport tests. Have a look, please, and let me know. Thanks! |
9874f17
to
e090764
Compare
spec/unit/message_spec.rb
Outdated
end | ||
|
||
context 'when data is not prsent' do | ||
it 'does not double the data' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for both of these tests, can you wrap the actual it
blocks in a loop with the array of blank/non-blank data?
something like:
context 'when data is not present' do
command = 'hi'
identifier = { 'hi': 'there' }
expected = {
command: command,
identifier: identifier.to_json
}.to_json
blank_data.each do |blank_datum|
it "does not set :data if the value would be #{blank_datum.inspect}" do
# in the data is present test, the expected will need to move in to here, but that's fine.
# msg =
# expect =
end
end
end
this way of organizing the specs allows for super easy at-a-glance debugging in case one of the cases of the loop fails (the test name tells which thing is specifically being tested)
looking good! just one more change, I think! |
e090764
to
49ec3e2
Compare
spec/unit/message_spec.rb
Outdated
Time.now] | ||
|
||
non_blank_data.each do |data| | ||
it "double the identifier and the data if the value would be #{data}" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should inspect be used here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It produces almost the same output, just a
vs "a"
but should improve readability, I guess.
49ec3e2
to
9c159ae
Compare
looks good! thanks! I'll release a new version shortly |
@srabuini 2.0.1 released. :-) |
What do you think about adding a simple helper and removing more than 11.000 lines of code?