Ignore folder when build using Middleman App - ruby

I want to ignore samples/ folder when build. I used this
configure :build do
activate :asset_hash, :ignore => [/^samples\//]
end
It didn't work and that folder was still included during build process. Could anyone advise?

Add the following code to your config.rb file:
ignore 'samples/*'
#ignore accepts regular expressions as well. See the specs.

Related

No spec files found when running Cypress using scripts in package.json

I am trying to use script aliases in the package.json file.
In order for something like this to open the test runner,
"cy:open:prod": "cypress open --env ENV=production",
I run the command npm run cy:open:prod in the command line in the same folder that package.json is located.
The script runs and opens the test runner, however no spec files are found.
In all the examples I have found it describes this approach. Is there something I am missing in configuation to point it to where my spec files are?
Thanks in advance.
There is nothing basically wrong with the scripts in package.json, they look normal and would not cause the problem you mention.
I suggest you check the specPattern setting in configuration, it should match the naming convention you have chosen to use for your specs.
See e2e settings for more details.
Of you still have trouble with it, start a new project and let Cypress set the configuration for you, it will automatically match up the specPattern to the default value.

Ruby Xcodeproj: Add file to non-group folder

I am trying to add the Google-Service.json (for Google Social Login) to my Xcode Project. As the project is build in a CI machine I cannot do it through Xcode.
I used Cocoapod's Xcodeproj package in order to help me add the json to my Xcode proj. The Runner folder seen below is not a group folder as Fluter or Products. With my created script I only achieve for the file to be added to the root of the project as seen in the picture. Can anyone tell me what to change so the project gets inside the Runner folder (as requested from Google_sign_in flutter plugin)
Here is my script:
require "xcodeproj"
project_path = "Runner.xcodeproj"
project = Xcodeproj::Project.open(project_path)
file = project.new_file("Google.json", "Runner")
main_target = project.targets.first
main_target.add_resources([file])
project.save
Thanks for any inputs
Don't know if it is still relevant. BUT i stumbled upon the same issue.
You need to add them inside the project root with ruby's FileUtils first.
FileUtils.cp(File.path(config_path), 'Runner')
I made a GitHub Gist with the whole script. With an example of my Run script also.

Rspec multiple spec folders

Im currently building a project using Rspec in which I sepparated in two different folders with domain code and infrastructure code. Both folders have their own specs in a spec folder. The domain/spec folder is the one containing the spec_helper.rb file, thats required from the tests inside the other folder infrastructure/spec
I'd like to know how to have a spec folder in the root of the project, including the spec_helper file and also tests, and being able to run all the tests with just one command (right now I do it running rspec domain/ infrastructure/)
RSpec is designed to work with all tests in one folder. By default, this folder is called spec/, but you can use a different name with the --default-path option.
So, your options as I see it are:
Edit the source code of rspec-core to let that configuration support multiple directories. Hopefully your PR will be approved and merged.
Or, write a simple wrapper script that runs rspec against both directories. For example, you could alias rspecs='rspec domain/ infrastructure/'.
Or (what I would recommend!), you could just restructure your tests slightly to use spec/domain/ and spec/infrastructure/ folders -- and then everything will just work, by convention, out of the box.

Capybara + RSpec, spec/features dir being ignored by the rspec . command?

I'm using the new Capybara DSL with rspec following the short guideline located here
And the tests added to the spec/features directory run well alone, ie.
rails_project$ rspec spec/features/my_first_feature.rb
However the spec/features directory is totally ignored when I try to run the tests for the entire spec/ directory like this:
rails_project$ rspec .
There is no mention in the guide about how to include this directory (or other directory) to accomplish this inclusion that I desire. I really need this for continuous integration of my project.
Can anybody please tell me how to do it?
Thanks!
You need to make sure all of your specs end in_spec.rb.
Change the filename to spec/features/my_first_feature_spec.rb
This is how I do it:
rspec spec
You may also want to use guard-rspec, which gives you better control.

override --fail-fast in rspec

I run specs in my local machine and in a CI server. In the first case I want specs to fail fast, and in the other I want run all of them. I've set --fail-fast in my .rspec file. How can I override it on the CI server? I run there RSpec using rake spec and I set SPEC_OPTS env variable.
The simplest answer is to remove .rspec from your repo. It is used only by you and any other contributor don't need to see that you are using NyanCat to see how your test's are doing.
You can add a .rspec file in your home directory so that the settings only apply to your local machine, and then the .rspec in the project directory will override any settings there.
--no-fail-fast has since been added.
https://relishapp.com/rspec/rspec-core/docs/command-line/fail-fast-option#using-%60--no-fail-fast%60

Resources