-
Notifications
You must be signed in to change notification settings - Fork 0
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
MardownChecklist2Hash implementation #1
Comments
|
require 'rails_helper'
RSpec.describe MarkdownChecklist do
describe '#each' do
context 'when there are no checklist items in source' do
it 'yields noting' do
source = <<~MARKDOWN
some markdown without checklist items
MARKDOWN
markdown_checklist = MarkdownChecklist.new(source)
expect { |b| markdown_checklist.each(&b) }.not_to yield_control
end
end
context 'when there checklist items in source' do
context 'when there was no header specified before checklist items' do
it 'yields summary of total and checked items for "nil" subject' do
source = <<~MARKDOWN
[ ] Item one
[x] Item two
MARKDOWN
markdown_checklist = MarkdownChecklist.new(source)
expect { |b| markdown_checklist.each(&b) }.to \
yield_with_args(nil, { total: 2, checked: 1 })
end
end
end
end
end
#
# mc = MarkdownChecklist.new('markdown')
#
#
# yield_successive_args([:a, :b], [:c, :d]) }
#
# expect { |b| markdown_checklist.each(&b) }.to \
# yield_successive_args([nil, { total: 2, checked: 1 }], ["GIT", { total: 2, checked: 5 }])
#
#
# ##
# [ ]
# [x]
#
# ##
# #
# # []
# mc.each do |subject, stats|
# # subject: "Working with GIT using CLI"
# # stats: { :total => 17, :checked => 15 }
# #
# #
# # # subject: nil
# # # stats: { :total => 17, :checked => 15 }
# #
# # subject: "Gems and Libraries -> Testing"
# # stats: {:total=>9, :checked=>7}
# # subject: "Gems and Libraries -> Development"
# # stats: {:total=>9, :checked=>7}
# end |
spec/lib/markdown_checklist_spec.rb |
|
|
|
|
pseudocode
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruby ~/Downloads/result.rb {url}
->"{:"Working with GIT using CLI"=>{:total=>17, :checked=>15}, :"Ruby core and stdlib"=>{:total=>150, :checked=>111, :_total=>1}, :Rails=>{:ActiveSupport=>{:total=>81, :checked=>19}}, :"Core rails skills"=>{:ActiveRecord=>{:total=>125, :checked=>112}, :"Views and Forms"=>{:total=>22, :checked=>13}, :ActionController=>{:total=>22, :checked=>13}, :Routing=>{:total=>25, :checked=>11}, :I18n=>{:total=>9, :checked=>0}, :"Action Mailer"=>{:total=>10, :checked=>6}, :"Active Job and Sidekiq"=>{:total=>11, :checked=>7}, :"Active Storage"=>{:total=>7, :checked=>0}, :"Action Cable"=>{:total=>2, :checked=>1}, :Testing=>{:total=>48, :checked=>37}}, :Patterns=>{:total=>21, :checked=>19}, :Other=>{:total=>21, :checked=>14}, :"Gems and Libraries"=>{:Development=>{:total=>19, :checked=>12}, :Testing=>{:total=>9, :checked=>7}}, :Tooling=>{:total=>5, :checked=>3}}"
"{:"Ruby core and stdlib"=>{:total=>152, :checked=>0, :small_blue_diamond_total=>22, :small_orange_diamond_total=>13, :small_red_triangle_total=>8, :_total=>1}, :ActiveSupport=>{:total=>88, :checked=>0, :small_orange_diamond_total=>11, :small_red_triangle_total=>6, :small_blue_diamond_total=>7}}"
Cover this behavior with tests
The text was updated successfully, but these errors were encountered: