Skip to content

Intercepting the script as shown in documentation example isn't preserving the variables for "When run source"  #289

@Sagar-svg

Description

@Sagar-svg

This example shown in the document demonstrates to preserve the variable while Intercepting the script executed for testing using "When run source".
link for it -> https://github.com/shellspec/shellspec#intercepting
I to reimplement this thing at my end. But it is not working out as expected.
The script im testing is :
Screenshot 2023-01-12 at 8 42 11 PM

The spec file is :
Screenshot 2023-01-12 at 8 36 38 PM

This is the output I am getting :
Screenshot 2023-01-12 at 8 22 18 PM

As this crearly demonstarates that it is failing to preserve the variable name1 and name2.
Here name1 should be "sagar" and name2 should be "sagar". But it is not getting preserved.
It seems that inside "end()" the %preserve is not working as expected.
Please look into this.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions