This repository has been archived by the owner on Mar 5, 2020. It is now read-only.
forked from jasmine/jasmine-gem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jasmine_rails2_spec.rb
93 lines (72 loc) · 2.72 KB
/
jasmine_rails2_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
if rails2?
describe "A Rails 2 app" do
before :each do
temp_dir_before
Dir::chdir @tmp
create_rails 'rails-example'
Dir::chdir 'rails-example'
end
after :each do
temp_dir_after
end
context "before Jasmine has been installed" do
it "should not the jasmine:install generator" do
output = `./script/generate --help`
output.should_not include('jasmine:install')
end
it "should not show jasmine:install help" do
output = `rails g`
output.should_not include('This will create')
end
it "should not show jasmine rake task" do
output = `rake -T`
output.should_not include("jasmine ")
end
it "should not show jasmine:ci rake task" do
output = `rake -T`
output.should_not include("jasmine:ci")
end
end
context "when the Jasmine generators are available" do
before :each do
`mkdir -p lib/generators && ln -s #{@root}/generators/jasmine lib/generators/jasmine`
end
it "should show the Jasmine generator" do
output = `./script/generate --help`
output.should include("Lib: jasmine")
end
it "should show jasmine:install help" do
output = `./script/generate jasmine --help`
output.should include("Usage: ./script/generate jasmine")
end
context "and been run" do
before :each do
`./script/generate jasmine`
end
it "should find the Jasmine configuration files" do
File.exists?("spec/javascripts/support/jasmine.yml").should == true
File.exists?("spec/javascripts/support/jasmine_runner.rb").should == true
File.exists?("spec/javascripts/support/jasmine_config.rb").should == true
end
it "should find the Jasmine example files" do
File.exists?("public/javascripts/Player.js").should == true
File.exists?("public/javascripts/Song.js").should == true
File.exists?("spec/javascripts/PlayerSpec.js").should == true
File.exists?("spec/javascripts/helpers/SpecHelper.js").should == true
File.exists?("spec/javascripts/support/jasmine.yml").should == true
File.exists?("spec/javascripts/support/jasmine_runner.rb").should == true
File.exists?("spec/javascripts/support/jasmine_config.rb").should == true
end
it "should show jasmine rake task" do
output = `rake -T`
output.should include("jasmine ")
end
it "should show jasmine:ci rake task" do
output = `rake -T`
output.should include("jasmine:ci")
end
end
end
end
end