Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--format documentation
--color
--require spec_helper
--order=random
10 changes: 4 additions & 6 deletions spec/next_rails_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading