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

Saturday MP Show #6: Adding Unit Tests for the Standard Ruby Linter ToDo Bug Fix

I add a unit test for the Standard Ruby linter bug fix done in the last episode. When adding the unit test I find out someone has improved the todo generation logic. Thank you. I also find a remove a redundant test.

Read about the bug being fixed here.

Checkout episode 5 where the bug was actually fixed:

Thanks to Test Double for creating Standard Ruby! 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 | Tagged , , , | Comments Off on Saturday MP Show #6: Adding Unit Tests for the Standard Ruby Linter ToDo Bug Fix

Saturday MP Show #5: Fixing the Standard (Ruby Linter) Existing ToDo List Bug

In this episode I implement a fix for the todo file generation bug in the Standard (Ruby linter) and do some manual testing. Also use ChatGPT to explain some code that GitHub Copilot generated.

Read about the bug being fixed here.

See the previous episode, number 4, where I create I duplicate the issue and come up with the fix possible fix.

Thanks to Test Double for creating Standard Ruby! 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 Saturday MP Show | Tagged , , | Comments Off on Saturday MP Show #5: Fixing the Standard (Ruby Linter) Existing ToDo List Bug

Saturday MP Show #4: Duplicating the Standard (Ruby Linter) Existing ToDo List Bug

I duplicate a todo file generation bug in the Standard (Ruby linter) and come up with a possible fix but don’t actually get to the fix.

Read about the bug here.

See episode #1 where I create a Docker development environment for Standard:

As a bonus at the beginning of the video I upgrade RubyMine to fix the bug we encountered in episode 2:

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 Saturday MP Show | Tagged , , | Comments Off on Saturday MP Show #4: Duplicating the Standard (Ruby Linter) Existing ToDo List Bug

Saturday MP Show #3: Filling out the JetBrains Developer Ecosystem Survey 2023

I, Chris, spend a lot longer then I anticipated filling out the JetBrains Developer Ecosystem Survey 2023. Thought it would be a quick half-hour but turned into 2 hours. Sorry in advance for the long video.

If you use the link below to take the survey I might win a prize:

https://surveys.jetbrains.com/s3/developer-ecosystem-survey-2023-sh?pcode=7200269898884107

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

Posted in Saturday MP Show | Tagged , , | Comments Off on Saturday MP Show #3: Filling out the JetBrains Developer Ecosystem Survey 2023

Saturday MP Show 2: Struggling to get the RubyMine Debugger Working

Chris fights to get the debugger working in RubyMine and does not make any progress on Standard. It was frustrating but overall Chris enjoys working with RubyMine so thank you JetBrains for creating it.

If you have any questions you would like answered in a future show or have constructive feedback please DM me or send an email to ask@saturdaymp.com.

Posted in Code Examples, Saturday MP Show, Software Development | Tagged , , , | Comments Off on Saturday MP Show 2: Struggling to get the RubyMine Debugger Working

Saturday MP Show #1: Creating a Docker Development Environment for Standard (Ruby Linter)

Chris creates a Docker environment for Standard which is a Ruby linter. Thank you to Test Double for creating Standard.

If you have any questions you would like answered or constructive feedback please send an email to ask@saturdaymp.com.

You can find my fork of the Standard repo here. Ideally all the files in the video would be in the repo but since we ignored the Docker files at a local level, they are listed below.

# Dockerfile
FROM ruby:3.2.2-alpine3.18

RUN apk update && \
    apk upgrade && \
    apk add --no-cache git build-base
# docker-compose.yml
services:
  app:
    build: .
    entrypoint: /app/docker-entrypoint.sh
    volumes:
      - .:/app
      - bundle-volume:/usr/local/bundle
    ports:
      - "1234:1234"
    working_dir: /app

volumes:
  bundle-volume:
# docker-entrypoint.sh
#!/bin/sh
set -e

bundle check || bundle install && bundle clean --force

exec "$@"
# .git/info/exclude
# File patterns to ignore; see `git help ignore` for more information.
# Lines that start with '#' are comments.

Dockerfile
docker-compose.yml
docker-entrypoint.sh

.idea/

Gemfile.lock
Posted in Code Examples, Saturday MP Show | Tagged , , , | Comments Off on Saturday MP Show #1: Creating a Docker Development Environment for Standard (Ruby Linter)