Skip to content

Commit

Permalink
experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
kudrykv committed Nov 13, 2024
1 parent 0172ff5 commit d4cbd13
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/119x158-leftie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ planner:
left_column_width: 6cm

left_column_items: [ top_priorities, notes, personal_notes ]
right_column_items: [ my_schedule ]
right_column_items: [ schedule ]

schedule_strftime: '%k'
schedule_from_hour: 8
Expand Down
2 changes: 1 addition & 1 deletion lib/latex_yearly_planner/planners/mos/pages/annual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def set(month_rows)
end

def title
<<~TYPST
<<~TYPST.squish
text(#{heading_size})[
#{first_month_name} #{first_year} ---
#{last_month_name} #{last_year}
Expand Down
4 changes: 0 additions & 4 deletions lib/latex_yearly_planner/planners/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
module LatexYearlyPlanner
module Planners
class Page < Base
def initialize(section_config:, i18n: I18n)
super(section_config:, i18n:)
end

def set(...)
raise NotImplementedError
end
Expand Down
44 changes: 44 additions & 0 deletions spec/latex_yearly_planner/planners/mos/pages/annual_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# frozen_string_literal: true

require 'rspec'

RSpec.describe LatexYearlyPlanner::Planners::Mos::Pages::Annual do
subject(:page) { described_class.new(section_config:) }

let(:month_rows) do
[
[
LatexYearlyPlanner::Calendar::Month.new(weekday_start:, year:, month: 1),
LatexYearlyPlanner::Calendar::Month.new(weekday_start:, year:, month: 2)
],
[
LatexYearlyPlanner::Calendar::Month.new(weekday_start:, year:, month: 3),
LatexYearlyPlanner::Calendar::Month.new(weekday_start:, year:, month: 4)
]
]
end
let(:weekday_start) { :monday }
let(:year) { 2024 }
let(:section_config) { instance_double(LatexYearlyPlanner::Adapters::SectionConfig) }
let(:config_operator) { instance_double(LatexYearlyPlanner::Adapters::ConfigOperator) }

before do
I18n.load_path = Dir['locales/*.yaml']
I18n.locale = :en
end

describe '#title' do
before do
allow(section_config).to receive(:params).and_return(config_operator)
allow(config_operator).to receive(:get).with(:heading_size).and_return('16pt')
allow(config_operator).to receive(:get).with(:months_per_page).and_return(4)
allow(config_operator).to receive(:months).and_return(month_rows.flatten)
end

it 'checks title' do
expect(page.set(month_rows).title).to eq <<~TYPST.squish
text(16pt)[ Jan 2024 --- Apr 2024 <annual-1> ]
TYPST
end
end
end

0 comments on commit d4cbd13

Please sign in to comment.