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

Moving functions added to the spy prototype to the spy instance. #10

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

longmatthewh
Copy link

One of the biggest changes is to prepare for Jasmine 2.x suport, which exposes "Spy" differently. We can no longer add new functions directly to the protoype. So, the functions we used to add to the prototype are now simply being added to the spy instance by using the new stealthy method. someSpy = jasmine.createSpy() becomes someSpy = stealthy(jasmine.createSpy()).

@searls
Copy link
Owner

searls commented Nov 21, 2014

This is a massively breaking change, no? How can we do this such that we also support back compat for 1.x, since that is still used by the majority of users.

On Thu, Nov 20, 2014 at 10:08 PM, Matt Long notifications@github.com
wrote:

One of the biggest changes is to prepare for Jasmine 2.x suport, which exposes "Spy" differently. We can no longer add new functions directly to the protoype. So, the functions we used to add to the prototype are now simply being added to the spy instance by using the new stealthy method. someSpy = jasmine.createSpy() becomes someSpy = stealthy(jasmine.createSpy()).
You can merge this Pull Request by running:
git pull https://github.com/longmatthewh/jasmine-stealth master
Or you can view, comment on it, or merge it online at:
#10
-- Commit Summary --

  • removing functions from spy protoype. we'll need this when we incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we incorporate changes to support jasmine 2.x
    -- File Changes --
    M .gitignore (2)
    A .idea/.name (1)
    A .idea/encodings.xml (5)
    A .idea/jasmine-stealth.iml (12)
    A .idea/jsLibraryMappings.xml (8)
    A .idea/libraries/jasmine_stealth_node_modules.xml (14)
    A .idea/misc.xml (5)
    A .idea/modules.xml (9)
    A .idea/scopes/scope_settings.xml (5)
    A .idea/vcs.xml (7)
    A .idea/workspace.xml (710)
    M README.md (8)
    M app/js/jasmine-stealth.coffee (38)
    M spec/jasmine-stealth-spec.coffee (17)
    -- Patch Links --
    https://github.com/searls/jasmine-stealth/pull/10.patch
    https://github.com/searls/jasmine-stealth/pull/10.diff

    Reply to this email directly or view it on GitHub:
    Moving functions added to the spy prototype to the spy instance. #10

@longmatthewh
Copy link
Author

It is. To avoid a major version change, I could change it so that for 1.x
the functions still get added to the prototype along with my change for 2.x
support.

Or, one thing I haven't tried is overriding Jasmine's cresteSpy to simply
call stealthy.

On Nov 20, 2014 11:07 PM, "Justin Searls" notifications@github.com wrote:

This is a massively breaking change, no? How can we do this such that we
also support back compat for 1.x, since that is still used by the majority
of users.

On Thu, Nov 20, 2014 at 10:08 PM, Matt Long notifications@github.com
wrote:

One of the biggest changes is to prepare for Jasmine 2.x suport, which
exposes "Spy" differently. We can no longer add new functions directly to
the protoype. So, the functions we used to add to the prototype are now
simply being added to the spy instance by using the new stealthy method.
someSpy = jasmine.createSpy() becomes someSpy = stealthy(jasmine.createSpy()).
You can merge this Pull Request by running:
git pull https://github.com/longmatthewh/jasmine-stealth master
Or you can view, comment on it, or merge it online at:
#10
-- Commit Summary --

  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
    -- File Changes --
    M .gitignore (2)
    A .idea/.name (1)
    A .idea/encodings.xml (5)
    A .idea/jasmine-stealth.iml (12)
    A .idea/jsLibraryMappings.xml (8)
    A .idea/libraries/jasmine_stealth_node_modules.xml (14)
    A .idea/misc.xml (5)
    A .idea/modules.xml (9)
    A .idea/scopes/scope_settings.xml (5)
    A .idea/vcs.xml (7)
    A .idea/workspace.xml (710)
    M README.md (8)
    M app/js/jasmine-stealth.coffee (38)
    M spec/jasmine-stealth-spec.coffee (17)
    -- Patch Links --
    https://github.com/searls/jasmine-stealth/pull/10.patch
    https://github.com/searls/jasmine-stealth/pull/10.diff

    Reply to this email directly or view it on GitHub:
    Moving functions added to the spy prototype to the spy instance. #10


Reply to this email directly or view it on GitHub.

@searls
Copy link
Owner

searls commented Nov 21, 2014

that would certainly do it. 

you could probably do some basic feature detection on the spy and branch to figure out which approach to attempt.

On Fri, Nov 21, 2014 at 5:56 AM, Matt Long notifications@github.com
wrote:

It is. To avoid a major version change, I could change it so that for 1.x
the functions still get added to the prototype along with my change for 2.x
support.
Or, one thing I haven't tried is overriding Jasmine's cresteSpy to simply
call stealthy.
On Nov 20, 2014 11:07 PM, "Justin Searls" notifications@github.com wrote:

This is a massively breaking change, no? How can we do this such that we
also support back compat for 1.x, since that is still used by the majority
of users.

On Thu, Nov 20, 2014 at 10:08 PM, Matt Long notifications@github.com
wrote:

One of the biggest changes is to prepare for Jasmine 2.x suport, which
exposes "Spy" differently. We can no longer add new functions directly to
the protoype. So, the functions we used to add to the prototype are now
simply being added to the spy instance by using the new stealthy method.
someSpy = jasmine.createSpy() becomes someSpy = stealthy(jasmine.createSpy()).
You can merge this Pull Request by running:
git pull https://github.com/longmatthewh/jasmine-stealth master
Or you can view, comment on it, or merge it online at:
#10
-- Commit Summary --

  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
  • removing functions from spy protoype. we'll need this when we
    incorporate changes to support jasmine 2.x
    -- File Changes --
    M .gitignore (2)
    A .idea/.name (1)
    A .idea/encodings.xml (5)
    A .idea/jasmine-stealth.iml (12)
    A .idea/jsLibraryMappings.xml (8)
    A .idea/libraries/jasmine_stealth_node_modules.xml (14)
    A .idea/misc.xml (5)
    A .idea/modules.xml (9)
    A .idea/scopes/scope_settings.xml (5)
    A .idea/vcs.xml (7)
    A .idea/workspace.xml (710)
    M README.md (8)
    M app/js/jasmine-stealth.coffee (38)
    M spec/jasmine-stealth-spec.coffee (17)
    -- Patch Links --
    https://github.com/searls/jasmine-stealth/pull/10.patch
    https://github.com/searls/jasmine-stealth/pull/10.diff

    Reply to this email directly or view it on GitHub:
    Moving functions added to the spy prototype to the spy instance. #10

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub:
#10 (comment)

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

Successfully merging this pull request may close these issues.

None yet

2 participants