From 80e1b85815c97cb819500d95632f05c7f637edd3 Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Mon, 4 May 2026 12:01:36 -0300 Subject: [PATCH] Randomize specs --- .rspec | 1 + spec/next_rails_spec.rb | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.rspec b/.rspec index 34c5164..57d1073 100644 --- a/.rspec +++ b/.rspec @@ -1,3 +1,4 @@ --format documentation --color --require spec_helper +--order=random diff --git a/spec/next_rails_spec.rb b/spec/next_rails_spec.rb index 0876d81..1f5b3f6 100644 --- a/spec/next_rails_spec.rb +++ b/spec/next_rails_spec.rb @@ -5,6 +5,10 @@ require "fileutils" RSpec.describe NextRails do + before(:each) do + NextRails.reset_next_bundle_gemfile + end + it "has a version number" do expect(NextRails::VERSION).not_to be nil end @@ -20,7 +24,6 @@ context "when it is set to Gemfile.next" do it "returns true" do FileUtils.touch("Gemfile.next") - NextRails.reset_next_bundle_gemfile with_env("BUNDLE_GEMFILE" => "Gemfile.next") expect(NextRails.next?).to be_truthy @@ -29,7 +32,6 @@ context "when Gemfile.next file does not exist" do it "returns false" do FileUtils.rm("Gemfile.next") - NextRails.reset_next_bundle_gemfile with_env("BUNDLE_GEMFILE" => "Gemfile.next") expect(NextRails.next?).to be_falsey @@ -40,7 +42,6 @@ context "when it is set to something else" do it "returns false" do FileUtils.touch("Gemfile4") - NextRails.reset_next_bundle_gemfile with_env("BUNDLE_GEMFILE" => "Gemfile4") expect(NextRails.next?).to be_falsey @@ -54,7 +55,6 @@ describe "NextRails.current?" do context "when BUNDLE_GEMFILE is not set" do it "returns true" do - NextRails.reset_next_bundle_gemfile expect(NextRails.current?).to be_truthy end end @@ -63,7 +63,6 @@ context "when it is set to Gemfile.next" do it "returns false" do FileUtils.touch("Gemfile.next") - NextRails.reset_next_bundle_gemfile with_env("BUNDLE_GEMFILE" => "Gemfile.next") expect(NextRails.current?).to be_falsey @@ -73,7 +72,6 @@ context "when it is set to something else" do it "returns true" do FileUtils.touch("Gemfile4") - NextRails.reset_next_bundle_gemfile with_env("BUNDLE_GEMFILE" => "Gemfile4") expect(NextRails.current?).to be_truthy