test/austin.rb in runeblog-0.2.44 vs test/austin.rb in runeblog-0.2.45

- old
+ new

@@ -2,12 +2,14 @@ major, minor = RUBY_VERSION.split(".").values_at(0,1) ver = major.to_i*10 + minor.to_i abort "Need Ruby 2.4 or greater" unless ver >= 24 -Home = Dir.pwd +# Home = Dir.pwd +require 'date' + require 'global' require 'runeblog' require 'repl' def bold(str) @@ -25,12 +27,17 @@ msec = time[n..(n+2)] time = t.strftime("%H:%M:%S") + msec STDERR.puts "#{'%-11s' % time} #{str}" end +@fake_date = Date.today - 20 + def make_post(x, title, teaser, body, views=[]) debug " make_post #{bold(title)}" - x.create_new_post(title, true, teaser: teaser, body: body, views: views) + pubdate = @fake_date.strftime("%Y-%m-%d") + @fake_date += (rand(2) + 1) + x.create_new_post(title, true, teaser: teaser, body: body, views: views, + pubdate: pubdate) end def show_lines(text) lines = text.split("\n") str = "#{lines.size} lines\n"