Saturday MP Show #12: Refactoring of a System Test While Fixing the Standard Ruby Linter ToDo Bug

Getting to the end of fixing the Standard Ruby Linter ToDo bug. In this video I refactor and remove duplicate code from a system tests that are similar. It goes well for the most part. The only hiccup is the trying to figure a way to run setup code once for all the tests in the file.

Read about the bug I’m trying to fix here. Other videos fixing the Standard Ruby Linter Todo Bug:

Thanks to Test Double for creating Standard! It is a great linter for Ruby projects.

Have question you want answered in a future video? A question I should ask you? Pair on a problem? Constructive feedback? Send an email to ask@saturdaymp.com.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , , , , | Comments Off on Saturday MP Show #12: Refactoring of a System Test While Fixing the Standard Ruby Linter ToDo Bug

SaturdayMP Show #11: Refactoring System Tests for the Standard Ruby Linter Todo Bug

The system test is finally working!! I go over, again, why it’s important to make sure your tests fail. Now that the test is working I start refactoring it to remove duplicate code.

Spent longer then I would have thought trying to get a before setup method to work in MiniTest. During my investigation I think I got the JetBrains AI to suggest a fix for a MiniTest PR that was rejected which was interesting to see.

Read about the bug I’m trying to fix here.

Other videos fixing the Standard Ruby Linter Todo Bug:

Thanks to TestDouble for creating Standard! It is a great linter for Ruby projects.

Have question you want answered in a future video? A question I should ask you? Pair on a problem? Constructive feedback? Send an email to ask@saturdaymp.com.

Contact me if you need help shipping secure high quality software faster. See Saturday Morning Productions for more details.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , , , | Comments Off on SaturdayMP Show #11: Refactoring System Tests for the Standard Ruby Linter Todo Bug

XPlugins.iOS.BEMCheckBox v2.0.0 Released!

I’m happy to announce that XPlugins.iOS.BEMCheckBox v2.0.0 has been released! This a wrapper for the BEMCheckBox which lets you create highly customizable, animated checkboxes for iOS. You can find the v2.0.0 NuGet package here.

BEMCheckBox Example Gif

This release includes all the fixes to the underlying BEMCheckBox from v1.4.1 to v2.0.0. This includes the following breaking changes:

  • Minimum iOS version was increased from 8.4 to 12.
  • Events renamed:
    • DidTapCheckBox renamed to DidTap
    • AnimationDidStopForCheckBox to AnimationDidStopFor

Give it a try and let me know if you spot any errors or improvements by opening a issue or pull request. Please also send me any questions you have via a issue.

Thank you Boris-Em for creating BEMCheckBox. Myself, and likely lots of other people, really appreciate it.

Posted in Releases, Software Development | Tagged , , , , , , | Comments Off on XPlugins.iOS.BEMCheckBox v2.0.0 Released!

Saturday MP Show #10: Finally get the System Test Working for the Standard Ruby Linter ToDo Bug

I get my system test working at the start of video but the problem is it works so well that it still passes even after I re-introduce the bug when it should have failed. Crap! That means my test is not working correctly.

I spend the rest of the video trying to figure out why the test is not failing when it should and get very frustrated. So frustrated this became my longest video yet at over two hours! End up digging into the RuboCop code to try and figure out what is going on. I do figure out the problem at the end of the video in a ah-ha moment. Spoiler: the problem was I didn’t link to the Standard config file correctly.

My personal takeaway from the video is I should have taken a break and viewed the problem later with fresh eyes and brain. A problem I’ve struggled with for as long as I can remember. Always easier to notice in hindsight.

On the plus side I think this video highlights the importance of making sure your test fails. Either by writing the test before your fix (e.g. test first development) or by reverting the fix like I did in this video. Writing passing tests is easy. Writing passing tests that actually correctly test your fix is harder.

Sorry for the long video and long sections of me thinking and not talking. Unless you like long videos of me struggling in silence, then you are welcome.

Read about the bug I’m trying to fix here.

Other videos fixing the Standard Ruby Linter Todo Bug:

Thanks to Test Double for creating Standard! It is a great linter for Ruby projects.

Have question you want answered in a future video? A question I should ask you? Pair on a problem? Constructive feedback? Send an email to ask@saturdaymp.com.

Contact me if you need help shipping secure high quality software faster. More details at Saturday Morning Productions.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , , , | Comments Off on Saturday MP Show #10: Finally get the System Test Working for the Standard Ruby Linter ToDo Bug

Saturday MP Show #9: Add 1.9 (e.g. almost 2) System Tests for the Standard Ruby Linter ToDo Bug

I get one system test working for generating the todo file and almost get the second test working. The second test that actually tests the bug we fixed. Went down a bit of rabbit hole trying to get the optimal Ruby file/directory manipulation code.

I also spent some time trying out JetBrains new coding AI. It has some issues but also lots of promise.

Read about the bug I’m trying to fix here. Other videos fixing the Standard Ruby Linter Todo Bug:

Thanks to Test Double for creating Standard! It is a great linter for Ruby projects.

Have question you want answered in a future video? A question I should ask you? Pair on a problem? Constructive feedback? Send an email to ask@saturdaymp.com.

Contact me if you need help shipping secure high quality software faster. More details at Saturday Morning Productions.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , , , , | Comments Off on Saturday MP Show #9: Add 1.9 (e.g. almost 2) System Tests for the Standard Ruby Linter ToDo Bug

BEMCheckBox v2.0.0 Released!

I’m happy to announce that BEMCheckBox v2.0.0 has been released! It is a open source library making it easy to create beautiful, highly customizable, animated checkboxes for iOS. You can find the install instructions here.

BEMCheckBox Example Gif

This a forked release as it does not appear the original project by Boris-EM is supported. If Boris-EM, or anyone else with access to original repo, is reading this I’m happy to merge my changes back. It should be noted that don’t have great track record of supporting my open source projects but I’m hoping to improve my stats.

This release includes all the fixes in the original repo along with a some new ones. It also has two breaking changes:

  • Minimum iOS supported switched from 8.4 to 12.
  • Event names have changed. Specifically didTapCheckBox to didTap and animationDidStopCheckBox to animationDidStop.

I have not pushed a new CocoaPods release. The last CocoaPods release was in 1.4.1. If this is something people are interested in please let me know and I’ll look into it. My main goal is to do another release of the Xamarin wrapper of the BEMCheckBox.

Truth be told I’m not very familiar with Xcode/Swift development so if anyone notices any issues with my fork please let me know by opening an issue or a pull request.

Thank you Boris-Em for creating BEMCheckBox. Myself, and likely lots of other people, really appreciate it.

Posted in Releases, Software Development | Tagged , , , | Comments Off on BEMCheckBox v2.0.0 Released!

Saturday MP Show #8: Another Failure at Adding System Test for the Standard Ruby Linter ToDo Bug Fix

Similar to the previous episode I fail at adding a system test. Should I be live coding all these failures? I think so. Maybe? Do they make boring videos? Probably. Should I say “ummm” less? Most definitely.

I think there are enough highly edited videos of success already it’s good to see some failures. To remind everyone that success takes work and often wrong paths. At least that sounds better then I don’t enjoy video editing so I just post what I record with minimal changes/edits.

I also like to imagine people figuring out the problem long before I do and are yelling at the screen. Like yelling at protagonist in a horror movie. “The problem is right there! No don’t go that way! You looked directly at the problem! You are so dumb!”

Spoiler alert: I do figure out root cause. At least I think I do. We will find out in the next video. A coding cliff hanger!

Read about the bug I’m trying to fix here.

See my previous fail adding a system test in the previous episode 7:

Thanks to Test Double for creating Standard! It is a great linter for Ruby projects.

Have question you want answered in a future video? A question I should ask you? Pair on a problem? Constructive feedback? Send an email to ask@saturdaymp.com.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , , | Comments Off on Saturday MP Show #8: Another Failure at Adding System Test for the Standard Ruby Linter ToDo Bug Fix

Happy System Administrator Appreciation Day!

Today, July 28th, 2023, is System Administrator Appreciation Day. A day I didn’t know existed until now but has been around since 2000.

It was during one of my first paid technical positions that I realized that sys admins, and other support staff including non-technical, can be a thankless job. A job where your only interactions with others is when something goes wrong.

During university I had a summer job as a Systems Analyst Trainee at TELUS Advertising Services (TAS). TAS was division of TELUS that created the phone books, both white (residential) and yellow (businesses) pages. I did typical IT tasks at the time such as setting up new computers with token ring network cards and helping staff issues such as accessing email. Also lots of printer issues.

I did get some thank-yous when I helped someone but most of the time it was complaints. Something was not working and it was causing the person stress, which is understandable, but did lead negative interactions. It wares you down when you have more negative then positive interactions.

It’s so easy to get used to something, start taking it for granted, then get frustrated when it’s not there. For example, we just assume we will be able to connect to the internet wherever we are. Home, driving, store, airplanes, etc. This is relatively new phenomena but already people complain when they don’t have internet for even a minute. Myself included.

So spend a couple minutes today thanking the Sys Admins that make your life better. Both at home and at work. You don’t have to go as far as this A.J. Jacobs did and tried to thank everyone who made his mooring cup of coffee but a couple thank-yous would be much appreciated.

In my case I would like to thank the admins who make it possible for me to be a Software Consultant. Thank you to the admins at Shaw who keep me connected to the internet. Thank you to the admins at Google, Slack, and Discord who let me communicate with clients and store information. Finally thank you admins at WP Engine who host this blog you are reading.

XCKD comic.

Posted in Fun, Support | Tagged | Comments Off on Happy System Administrator Appreciation Day!

Saturday MP Show #7: Trying to Add a System Test for the Standard Ruby Linter ToDo Bug Fix

I, Chris, try to add a system test for the todo bug fix in episode 5 but run into some issues. I find out I stupidly hard coded the todo file name when he first added the ability to generate a todo file in Standard. When recording this video I think that is why his system test doesn’t work but upon re-watching this video I have my doubts. Only time will tell if my doubts are correct or not.

On the plus side at the beginning of the video I do refactor the fix and the unit test.

Read about the bug being fixed here.

Checkout episode 5 where the bug was actually fixed. See where the unit test is created in episode 6.

Thanks to Test Double for creating Standard! I use it whenever I can.

Have question you want answered in a future video or constructive feedback? Send an email to ask@saturdaymp.com.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , | Comments Off on Saturday MP Show #7: Trying to Add a System Test for the Standard Ruby Linter ToDo Bug Fix

NConstraints v1.1.1 Released Now Targets .NET Standard 2.0

I’m happy to announce that NConstraints v1.1.1 has been released! This release updates the NuGet package from .NET Standard 1.6 to 2.0 and should work with all versions of NUnit 3.

You can install NConstraints via the dotnet command line:

dotnet add package SaturdayMP.NConstraints --version 1.1.1

Other install options can be found here.

NConstraints currently only has one constraint called EquivalentPropertyWiseTo. It checks if all the property values on two objects are the same. Instead of writting:

[Test]
public void TestObjectsTheSame()
{
  var expected = new ExpectedClass() { ValueOne = 1, ValueTwo = "Blah", ValueThree = 33 };

  var actual = MethodBeingTested();
   
  Assert.That(expected.ValueOne, Is.EqualTo(actual.ValueOne));
  Assert.That(expected.ValueTwo, Is.EqualTo(actual.ValueTwo));
  Assert.That(expected.ValueThree, Is.EqualTo(actual.ValueThree));
}

You can write:

[Test]
public void TestObjectsTheSame()
{
  var expected = new ExpectedClass() { ValueOne = 1, ValueTwo = "Blah" };

  var actual = MethodBeingTested();
   
  Assert.That(expected, Is.EquivalentPropertyWiseTo(actual));
}

You can find more details on the NConstraints GitHub page. If you have any questions, notice a bug, or have improvements please let me know by:

P.S. – You can ignore the v.1.1.0 release. I accidently made NConstraints only compatible with NUnit 3.13.3 or higher instead of all NUnit 3.* versions.

Posted in Uncategorized | Comments Off on NConstraints v1.1.1 Released Now Targets .NET Standard 2.0