GithubHelp home page GithubHelp logo

Comments (11)

myronmarston avatar myronmarston commented on August 15, 2024

@moonglum -- I believe this is the same issue that was reported in rspec/rspec-mocks#619 and fixed in rspec/rspec-core#1372.

Can you try updating the the master branches of the rspec repos and seeing if that fixes it?

Thanks!

from rspec-its.

moonglum avatar moonglum commented on August 15, 2024

@myronmarston I tried updating both rspec and rspec-its to master, this doesn't change it unfortunately.

from rspec-its.

cupakromer avatar cupakromer commented on August 15, 2024

@moonglum so the main RSpec is really just a host for specifying the other RSpec gems. Since the github repo version for it is '3.0.0.beta2', it will only attempt to require the same version of the other RSpec gems.

Can you try again after adding the following to your Gemfile:

gem 'rspec-core', git: 'git://github.com/rspec/rspec-core'

from rspec-its.

moonglum avatar moonglum commented on August 15, 2024

If I add this line, I get the following error when I run it via either rake or directly:

NoMethodError: undefined method `require_rspec_support' for RSpec::Support:Module
/Users/moonglum/.rvm/gems/ruby-2.1.1/bundler/gems/rspec-core-e204adc93d07/lib/rspec/core/rake_task.rb:2:in `<top (required)>'
/Users/moonglum/Code/ashikawa-core/Rakefile:4:in `require'
/Users/moonglum/Code/ashikawa-core/Rakefile:4:in `<top (required)>'
/Users/moonglum/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/moonglum/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

from rspec-its.

myronmarston avatar myronmarston commented on August 15, 2024

rspec-core HEAD relies on changes in rspec-support HEAD that were not present in the beta2 release. You'll need to add gem 'rspec-support', git: 'git://github.com/rspec/rspec-support' to your Gemfile as well. In general, the repos are developed together so it may be best to use HEAD of all of them:

%w[ core mocks expectations support ].each do |name|
 gem "rspec-#{name}", github: "rspec/rspec-#{name}"
end

from rspec-its.

moonglum avatar moonglum commented on August 15, 2024

Ok, thank you! I've changed that now. This leads to a different set of errors [Build on Travis is in progress]:

1) Ashikawa::Core::ResourceNotFound to_s should include "was not found"
     Failure/Error: its(:to_s) { should include 'was not found' }
       expected "to_s" to include "was not found"
     # ./spec/unit/exception_spec.rb:32:in `block (2 levels) in <top (required)>'

[...]

10) Ashikawa::Core::Configuration adapter
     Failure/Error: its(:adapter) { should be_nil }
     NoMethodError:
       undefined method `adapter' for :adapter:Symbol
     # ./spec/unit/configuration_spec.rb:15:in `block (2 levels) in <top (required)>'

Seems like the its block executes the expectations on the symbol given as the argument to its.

from rspec-its.

myronmarston avatar myronmarston commented on August 15, 2024

You've run into #12, which I reported recently but hasn't yet been fixed.

In the mean time, either of these should work:

  • Change the argument passed to its from a symbol to a string.
  • Pin your rspec-core to a ref from after the mock lifecycle fix but before we changed describe :symbol to make subject refer to that symbol. For example, if you add ref: '5fe4dc352255a6396f521f1d0350cb32921462b7' to the rspec-core entry in your Gemfile.

from rspec-its.

moonglum avatar moonglum commented on August 15, 2024

Ok, thank you! I will wait for the fix of rspec-its and then report if everything is working – and then close this issue! For that time I will stay on the 2.99 release. Looking forward to switching to 3.0 though, especially for verifying doubles 😄

from rspec-its.

apneadiving avatar apneadiving commented on August 15, 2024

Not sure where to tell it, but I had the very same error while using an around hook.

I changed to before, works fine now

from rspec-its.

myronmarston avatar myronmarston commented on August 15, 2024

@apneadiving -- that sounds like an rspec-core issue. Can you open an issue there with an example of what you were doing?

from rspec-its.

apneadiving avatar apneadiving commented on August 15, 2024

@myronmarston ok done here: rspec/rspec-core#1598

from rspec-its.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.