Giter Club home page Giter Club logo

convenient_service's Introduction

convenient_service's People

Contributors

alexdashko1337 avatar alexfrstnberg avatar github-actions[bot] avatar marian13 avatar mashapetrusiak avatar nazar-kostyk avatar nickukraine24 avatar olha-30 avatar vmalakhivskyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

convenient_service's Issues

`stub_service` does NOT mock in combination with `delegate_to`

What is the issue?

  • stub_service does NOT mock in combination with delegate_to.

When it happens? How to reproduce it?

  • Try to uncomment the spec in cowsay_spec.rb.

    context "when `out` is NOT passed" do
      include ConvenientService::RSpec::Helpers::StubService
       
      it "defaults to `stdout`" do
        stub_service(described_class::Services::Print).to return_success
       
        expect { described_class.print(text) }
          .to delegate_to(described_class::Services::Print, :result)
          .with_arguments(text: text, out: $stdout)
      end
    end
  • Then run specs.

    task rspec -- spec/lib/convenient_service/examples/standard/cowsay_spec.rb 

Where it happens?

  • It does NOT depend on the environment. Fails for all Rubies.
  • RSpec 3.

How big is the damage from it?

  • Minimal. For now, such a combo is rare.

Why it happens?

  • allow ... and_wrap_original inside delegate_to overrides allow ... and_wrap_original inside stub_service.
  • According to the RSpec own specs and internal implementation ignoring the previous and_wrap_original is expected behavior.

What can be done to resolve it?

What is the complexity of a possible fix?

  • Looks hard. Maybe a hack is needed. More precise ETA after a deeper investigation.

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.