First some context:

I was trying to find the limit of $\frac{e^x - 1}{x}$ as x approaches zero without using L'Hopital's rule to avoid circular reasoning. 

Then, I was told that I could use the definition:

$$e = \lim\_{n\to\infty} \left( 1+\frac{1}{n} \right)^n$$
The trick is to set $n = \frac{1}{x}$

$$e = \lim\_{x\to 0} ( 1+x )^\frac{1}{x}$$

So, my limit becomes:
$$\lim\_{x\to 0} \frac{1+x-1}{x} = 1$$

This makes sense on an intuitive level. By setting n equal to $\frac{1}{x}$, I am approaching the limit from a specific direction on a two-dimensional plane. However, I have not worked with two-dimensional limits before. When is this allowed? Surely there must be situations in which this does not work because the limit is different depending upon what path you use to approach the point at which you are taking the limit. How do you test if this "trick" gives the correct answer?