|
32 | 32 | client1 = JenkinsApi::Client.new( |
33 | 33 | YAML.load_file(File.expand_path(@creds_file, __FILE__)) |
34 | 34 | ) |
35 | | - client1.class.should == JenkinsApi::Client |
| 35 | + expect(client1.class).to eq JenkinsApi::Client |
36 | 36 | end |
37 | 37 |
|
38 | 38 | it "Should accept a YAML argument when creating a new client" do |
39 | 39 | client3 = JenkinsApi::Client.new( |
40 | 40 | YAML.load_file(File.expand_path(@creds_file, __FILE__)) |
41 | 41 | ) |
42 | | - client3.class.should == JenkinsApi::Client |
| 42 | + expect(client3.class).to eq JenkinsApi::Client |
43 | 43 | end |
44 | 44 |
|
45 | 45 | it "Should fail if wrong credentials are given" do |
|
49 | 49 | :password => 'hacked', |
50 | 50 | :log_location => '/dev/null' |
51 | 51 | ) |
52 | | - expect( |
53 | | - lambda { client2.job.list_all } |
54 | | - ).to raise_error(JenkinsApi::Exceptions::Unauthorized) |
| 52 | + expect{ client2.job.list_all }.to raise_error(JenkinsApi::Exceptions::Unauthorized) |
55 | 53 | end |
56 | 54 | end |
57 | 55 | describe "#get_jenkins_version" do |
58 | 56 | it "Should the jenkins version" do |
59 | | - @client.get_jenkins_version.class.should == String |
| 57 | + expect(@client.get_jenkins_version.class).to eq String |
60 | 58 | end |
61 | 59 | end |
62 | 60 |
|
63 | 61 | describe "#get_hudson_version" do |
64 | 62 | it "Should get the hudson version" do |
65 | | - @client.get_hudson_version.class.should == String |
| 63 | + expect(@client.get_hudson_version.class).to eq String |
66 | 64 | end |
67 | 65 | end |
68 | 66 |
|
69 | 67 | describe "#exec_script" do |
70 | 68 | it "Should execute the provided groovy script" do |
71 | | - @client.exec_script('println("hi")').should == "hi\n" |
| 69 | + expect(@client.exec_script('println("hi")')).to eq "hi\n" |
72 | 70 | end |
73 | 71 | end |
74 | 72 | end |
75 | 73 |
|
76 | 74 | describe "SubClassAccessorMethods" do |
77 | 75 | describe "#job" do |
78 | 76 | it "Should return a job object on call" do |
79 | | - @client.job.class.should == JenkinsApi::Client::Job |
| 77 | + expect(@client.job.class).to eq JenkinsApi::Client::Job |
80 | 78 | end |
81 | 79 | end |
82 | 80 |
|
83 | 81 | describe "#node" do |
84 | 82 | it "Should return a node object on call" do |
85 | | - @client.node.class.should == JenkinsApi::Client::Node |
| 83 | + expect(@client.node.class).to eq JenkinsApi::Client::Node |
86 | 84 | end |
87 | 85 | end |
88 | 86 |
|
89 | 87 | describe "#view" do |
90 | 88 | it "Should return a view object on call" do |
91 | | - @client.view.class.should == JenkinsApi::Client::View |
| 89 | + expect(@client.view.class).to eq JenkinsApi::Client::View |
92 | 90 | end |
93 | 91 | end |
94 | 92 |
|
95 | 93 | describe "#system" do |
96 | 94 | it "Should return a system object on call" do |
97 | | - @client.system.class.should == JenkinsApi::Client::System |
| 95 | + expect(@client.system.class).to eq JenkinsApi::Client::System |
98 | 96 | end |
99 | 97 | end |
100 | 98 |
|
101 | 99 | describe "#queue" do |
102 | 100 | it "Should return a build queue object on call" do |
103 | | - @client.queue.class.should == JenkinsApi::Client::BuildQueue |
| 101 | + expect(@client.queue.class).to eq JenkinsApi::Client::BuildQueue |
104 | 102 | end |
105 | 103 | end |
106 | 104 | end |
|
129 | 127 | end |
130 | 128 |
|
131 | 129 | it "Should connect without an error" do |
132 | | - expect { client.job.list_all }.not_to raise_error |
| 130 | + client.job.list_all |
133 | 131 | end |
134 | 132 | end |
135 | 133 | end |
|
0 commit comments