Undefined Step Definitions when Running Cucumber scripts in command line - ruby

I was previously using RubyMine to run cucumber test scripts and it works just fine, but I am looking for an alternative to run those scripts from command line.
When I try to run a specific .feature file from cmd, I get an error stating that my Ruby step definitions are undefined. I am assuming this is because they are not located in the same directory as the .feature file that I am trying to run.
Here is my cmd output:
Undefined Steps error output
Any suggestions welcome! Thanks

If you're running cucumber from your_directory. Then your .feature files should be in your_directory/features and step definitions (.rb files) in your_directory/features/step_definitions Subfolders are supported.
Look at https://docs.cucumber.io/guides/10-minute-tutorial/
If you're running Win10, check WSL - makes your life better ;-)

Related

zsh: command not found: hiptest-publisher

I'm using hiptest-publisher in order to push test results on the cucumber studio platform. The tests run and pass.
I installed Ruby and then ran gem install hiptest-publisher.
When I try to run this command to push the test execution result back to Cucumber Studio:
hiptest-publisher --config-file=<path> --push="target/cucumber.json" --push-format=cucumber-json --test-run-id=123
I receive this error:
Any advice to solve this problem is welcome.
Thanks a lot!
Problem solved!
How did I solve it?
Step 1
$ gem environment
Will tell you the EXECUTABLE DIRECTORY.
Step 2
Put whatever that value is in your PATH in your .bashrc or other shell config file.
export PATH="$PATH:/path/to/bin"
Thank you!

Cant run wasm module on cmd. Error: failed to run main module `demo.wasm`

Hi I'm new in programing in general I know just web dev. So I'm interested in develop in rust ussing webassembly wasm, wasmp-pack, webpack, wasi and in this case the runtime demo of wasmtime but Im stuck here and seriously I dont know even where
to look to begin with so, heres the error...
Error: failed to run main module `demo.wasm`
Caused by:
0: failed to read `demo.wasm` to a string
1: The system cannot find the file specified. (os error 2)
wasmtime 0.20.0
Wasmtime WebAssembly Runtime```
Im running
windows 10
using cmd
rustup
Thanks
The syntax I was using its wrong!!!!!
'''demo>wasmtime .\target\wasm32-wasi\debug\demo.wasm'''
'''Hello, world!'''
At the begging it appears that wasmtime needs to be invoke to initialize from the root folder that you installed and the go and run the path
This its a recurring thing for me using cmd to run frameworks programs developed with bash or terminal in mind its hell on windows I hope that this serves well to ALL developers. Young or old, inexperienced or bash users stuck in a windows cmd for the day.
Funny thing if you take that same command and remove wasmtime from the beginning it shows you the actual source code of the module in whatever program you have configure to open wasm files and if you dont have one prompts you an alert that there is not such program bind to the file extension.
So the command works for cmd only and if you notice its all backslashes which its the opposite of bash but wait, not always!
So this is just ANOTHER configuration that happens to work with wamstime. But what is this? Is it regular expressions?
In my case, there where no .wasm file matching the wasmtime first argument.

Rubymine (Ruby): Why can't I run rspec from within the IDE?

If I run the following command from the terminal I am able to run the rspec test cases successfully.
bundle exec rspec spec/requests/api/contacts/v3_get_tags_spec.rb
However if I am in the Rubymine IDE and do:
1- Right click on the file
2- Select "Run"
Then i get the following error message.
"in `require': cannot load such file -- spec_helper (LoadError)"
Also i am seeing a lot of errors related to gems not found, i feel link Rubymine is not configured correctly. What am i missing?
Note: Both the terminal and the IDE are running in the same root directory. I am pretty sure there is a problem with the configuration of the IDE. I checked the preference setting and it is using the same version of ruby as the one I am running in the termina.
Any help on the issue would be greatly appreciated.

Error while trying to run Pharo for the first time

I am trying to run Pharo on my system (Ubuntu 17.10 64bit).I followed the exact procedure as given in the book Pharo By Example.
I Went into the Pharo6.1-64 directory and ran the following command in the terminal
./pharo shared/pharo6.1-64.image
I expected this to open the Pharo window where I can write code but instead saw this error in the Terminal.
./pharo: line32: /home/user/pharo6.1-64/vm/pharo: No such file or directory.
Do I need to download any additional files ?
I downloaded the zip from here and it said just extract and run.
It looks like there is something wrong with the file you downloaded. It does not seem to contain a vm. For now, try the other method mentioned in the book:
wget -O- get.pharo.org/50+vm | bash
Copy the pharo.image and pharo.changes to the directory containing the pharo executable and from terminal run the command
Pharo_executable path_to_Pharo_image

Ruby - watch for file with extension being updated

I am trying to auto compile my less files on centos.
Is it possible in ruby to watch a directory for changes to files ending in a specific extension and then execute a command when that happens?
I have tried inotify in a simple shell script but there are always problems when an ide creates temporary files etc.
You want inotify. A Ruby wrapper, rb-notify, is available.
The ZenTest gem includes the autotest command-line tool, which watches a test directory and runs tests when one of the files changes.
Go look at how that tool works. Using inotify is helpful but not necessary.
The basic idea for this is to write a loop with a sleep inside it. Use Ruby's Find class to locate the files that are candidates for processing. The Find documentation has example code to get that part started.

Resources