Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rspec-rails requirement from ~> 3.1 to ~> 6.0 #501

Merged
merged 1 commit into from
Mar 20, 2023
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
2 changes: 1 addition & 1 deletion spec/statesman/adapters/active_record_queries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def self.initial_state; end
end

it "does not raise an error" do
expect { check_missing_methods! }.to_not raise_exception(NotImplementedError)
expect { check_missing_methods! }.to_not raise_exception
end
end

Expand Down
8 changes: 3 additions & 5 deletions spec/statesman/adapters/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
end

describe "#create" do
subject { -> { create } }
subject(:transition) { create }

let!(:adapter) do
described_class.new(MyActiveRecordModelTransition, model, observer)
Expand Down Expand Up @@ -173,19 +173,17 @@
end
end

it { is_expected.to raise_exception(ActiveRecord::RecordNotUnique) }
it { expect { transition }.to raise_exception(ActiveRecord::RecordNotUnique) }
end

context "other errors" do
let(:error) { StandardError }

it { is_expected.to raise_exception(StandardError) }
it { expect { transition }.to raise_exception(StandardError) }
end
end

describe "updating the most_recent column" do
subject { create }

context "with no previous transition" do
its(:most_recent) { is_expected.to eq(true) }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/statesman/adapters/shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
end

describe "#create" do
subject { -> { create } }
subject(:transition) { create }

let(:from) { :x }
let(:to) { :y }
let(:there) { :z }
let(:create) { adapter.create(from, to) }

it { is_expected.to change(adapter.history, :count).by(1) }
it { expect { transition }.to change(adapter.history, :count).by(1) }

context "the new transition" do
subject(:instance) { create }
Expand Down
16 changes: 8 additions & 8 deletions spec/statesman/machine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

describe ".remove_state" do
subject(:remove_state) { -> { machine.remove_state(:x) } }
subject(:remove_state) { machine.remove_state(:x) }

before do
machine.class_eval do
Expand All @@ -39,7 +39,7 @@
end

it "removes the state" do
expect(remove_state).
expect { remove_state }.
to change(machine, :states).
from(match_array(%w[x y z])).
to(%w[y z])
Expand All @@ -49,7 +49,7 @@
before { machine.transition from: :x, to: :y }

it "removes the transition" do
expect(remove_state).
expect { remove_state }.
to change(machine, :successors).
from({ "x" => ["y"] }).
to({})
Expand All @@ -59,7 +59,7 @@
before { machine.transition from: :x, to: :z }

it "removes all transitions" do
expect(remove_state).
expect { remove_state }.
to change(machine, :successors).
from({ "x" => %w[y z] }).
to({})
Expand All @@ -71,7 +71,7 @@
before { machine.transition from: :y, to: :x }

it "removes the transition" do
expect(remove_state).
expect { remove_state }.
to change(machine, :successors).
from({ "y" => ["x"] }).
to({})
Expand All @@ -81,7 +81,7 @@
before { machine.transition from: :z, to: :x }

it "removes all transitions" do
expect(remove_state).
expect { remove_state }.
to change(machine, :successors).
from({ "y" => ["x"], "z" => ["x"] }).
to({})
Expand All @@ -104,7 +104,7 @@
end

it "removes the guard" do
expect(remove_state).
expect { remove_state }.
to change(machine, :callbacks).
from(a_hash_including(guards: match_array(guards))).
to(a_hash_including(guards: []))
Expand All @@ -125,7 +125,7 @@
end

it "removes the guard" do
expect(remove_state).
expect { remove_state }.
to change(machine, :callbacks).
from(a_hash_including(guards: match_array(guards))).
to(a_hash_including(guards: []))
Expand Down
2 changes: 1 addition & 1 deletion statesman.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "~> 3.1"
spec.add_development_dependency "rspec-github", "~> 2.4.0"
spec.add_development_dependency "rspec-its", "~> 1.1"
spec.add_development_dependency "rspec-rails", "~> 3.1"
spec.add_development_dependency "rspec-rails", "~> 6.0"
spec.add_development_dependency "sqlite3", "~> 1.6.1"
spec.add_development_dependency "timecop", "~> 0.9.1"

Expand Down