How do I write a test on Linux system meets minimum kernel version of 2.6.20 or greater inside the following file?
spec/unit.recipes/default_spec.rb
ChefSpec isn't used for things like this, it doesn't know anything about actual systems. It just runs your recipe code in an abstract no-op-y kind of way. Most Chef users neither need nor should use ChefSpec, it's for stupidly complex cookbooks mostly, like the kind released to the community.
You should use an integration testing tool like test kitchen for that since chefspec doesn't run on a actual machine where as kitchen tests does. You can use either serverspec or inspec as your testing framework. Refer https://docs.chef.io/kitchen.html