require 'rails_helper'

RSpec.describe Game, type: :model do
  context "when I create a new game" do
    context "with no arguments" do
      subject(:game) { Game.new }
      let(:default_starting_score) { 10 }
      let(:default_starting_word)  { "hangman" }

      describe "#score" do
        it "should be set" do
          expect(game.score).not_to be_nil
        end

        it "should be the default" do
          expect(game.score).to eql default_starting_score
        end
      end

      describe "#word" do
        it "should be set" do
          expect(game.word).not_to be_nil
        end

        it "should be the default" do
          expect(game.word).to eql default_starting_word
        end
      end
    end
  end
end

require 'rails_helper'

RSpec.describe Game, type: :model do
  context "when I create a new game" do
    context "with no arguments" do
      subject(:game) { Game.new }
      let(:default_starting_score) { 10 }
      let(:default_starting_word)  { "hangman" }

      describe "#score" do
        subject { game.score }

        it "should be set" do
          is_expected.not_to be_nil
        end

        it "should be the default" do
          is_expected.to eql default_starting_score
        end
      end

      describe "#word" do
        subject { game.word }

        it "should be set" do
          is_expected.not_to be_nil
        end

        it "should be the default" do
          is_expected.to eql default_starting_word
        end
      end
    end
  end
end

Change rspec tests to make better use of subject
Change rspec tests to make better use of subject
