Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix issue #378 Rspec integration names file '.yml' when using rspec one ... #380

wants to merge 1 commit into


None yet
2 participants

Fix issue #378 Rspec integration names file '.yml' when using rspec one line syntax.

When you use rspec one line syntax it {} the description is an empty string so the cassette name ends up ending with a / then you get an invisible file named .yml.


myronmarston commented Jan 23, 2014

I thought we had talked about raising an error in this case to force the user to specify the cassette name by hand?

We did before I discovered this bug. It seems to work perfectly in my project.

I'm going to work on adding some specs test for this later tonight.

Here is one block that previously created ".yml" files.

describe "One (paused) Offer" do
      subject { offer }
      it { should_not be_nil }
      its(:title) { should eql("Nicholas M. Gistaro, D.M.D") }
      its(:external_id) { should eql("779106000") }
      its(:start_time) { should_not be_nil }
      its(:end_time) { should be_nil }
      its(:order_type) { should eql("CPC") }
      its(:status) { should eql("active") } # budget_remain > CPC ? active : paused
      its(:budget_remain) { should eql(0.18574081) }
      its(:cpc) { should eql(0.51) }
      its(:ctr) { should eql(0.004) }

And now I get the files I expected.

$cd One_paused_Offer
$ ls

myronmarston commented Jan 23, 2014

Where did shard_save.yml and creative.yml come from? And what cassette does it { should_not be_nil } correspond to?


myronmarston commented Jan 23, 2014

BTW, using its in combination with VCR is not something I would recommend. Any test involving VCR is going to be quite slow (but orders of magnitude faster than a real HTTP request would be), and I think it's a poor tradeoff to use its and re-do the setup (e.g. making the HTTP request) for each example. Instead, I would tend to make this one example, and put multiple assertions in that example.

@jspooner jspooner closed this Jan 24, 2014

I didn't copy the full block because the other 2 test used the normal syntax. it { should_not be_nil } actually generated a file one directory up named One_paused_Offer.yml. This would be a problem if there are multiple it {} tests.

I'll close this and add the fix we talked about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment