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

Warning about missing #description method. #41

Open
sungwoncho opened this issue Apr 11, 2015 · 2 comments
Open

Warning about missing #description method. #41

sungwoncho opened this issue Apr 11, 2015 · 2 comments

Comments

@sungwoncho
Copy link

When I run a spec, I get the following warning:

specify { expect(object).to matcher }

or this:

it { is_expected.to matcher }

RSpec expects the matcher to have a #description method. You should either
add a String to the example this matcher is being used in, or give it a
description method. Then you won't have to suffer this lengthy warning again.

My spec looks like this:

  specify { 
    expect(destination_root).to have_structure { 
      directory "db" do
        directory "migrate" do
          migration "create_friendships"
        end
      end
    }
  }

Is it the way I am using this gem, or is there something missing in the gem, as the warning suggests?

@bobf
Copy link

bobf commented Sep 27, 2018

@sungwoncho You're not missing anything. This code removes the warning (though not with anything useful):

class GeneratorSpec::Matcher::File
  def description
    'hello'
  end
end

class GeneratorSpec::Matcher::Directory
  def description
    'hello'
  end
end

I'll submit a PR to fix it properly if the author is interested ? @stevehodgkiss

@stevehodgkiss
Copy link
Owner

Sounds good @bobf 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants