diff --git a/spec/statesman/adapters/active_record_queries_spec.rb b/spec/statesman/adapters/active_record_queries_spec.rb index 685734eb..e57dc9e6 100644 --- a/spec/statesman/adapters/active_record_queries_spec.rb +++ b/spec/statesman/adapters/active_record_queries_spec.rb @@ -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 diff --git a/spec/statesman/adapters/active_record_spec.rb b/spec/statesman/adapters/active_record_spec.rb index f82b0a9d..0cb7d42d 100644 --- a/spec/statesman/adapters/active_record_spec.rb +++ b/spec/statesman/adapters/active_record_spec.rb @@ -112,7 +112,7 @@ end describe "#create" do - subject { -> { create } } + subject(:transition) { create } let!(:adapter) do described_class.new(MyActiveRecordModelTransition, model, observer) @@ -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 diff --git a/spec/statesman/adapters/shared_examples.rb b/spec/statesman/adapters/shared_examples.rb index 837ddb50..67a3bcc8 100644 --- a/spec/statesman/adapters/shared_examples.rb +++ b/spec/statesman/adapters/shared_examples.rb @@ -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 } diff --git a/spec/statesman/machine_spec.rb b/spec/statesman/machine_spec.rb index d8b748b5..04842fb8 100644 --- a/spec/statesman/machine_spec.rb +++ b/spec/statesman/machine_spec.rb @@ -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 @@ -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]) @@ -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({}) @@ -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({}) @@ -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({}) @@ -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({}) @@ -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: [])) @@ -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: [])) diff --git a/statesman.gemspec b/statesman.gemspec index 7e350065..5dea7a16 100644 --- a/statesman.gemspec +++ b/statesman.gemspec @@ -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"